get date count between two dates in php code example
Example 1: php get date between two dates
$period = new DatePeriod(
new DateTime('2010-10-01'),
new DateInterval('P1D'),
new DateTime('2010-10-05')
);
//Which should get you an array with DateTime objects.
//To iterate
foreach ($period as $key => $value) {
//$value->format('Y-m-d')
}
Example 2: php check if date between two dates
Current date is between two dates