$start = new DateTime('2013-08-16');
$interval = new DateInterval('P1D');
$end = new DateTime('2013-08-20');
$end->add(new DateInterval('P1D'));
$period = new DatePeriod($start, $interval, $end);
foreach ($period as $date) {
echo $date->format('Y-m-d') . "<br />";
}
I found the above code to get all dates between two static dates.
What I would like is to get the dates between multiple $start $end pairs. The scenario is to associate the variables ($start, &end) with fields from a db in order to make multiple pairs and get the between dates of these pairs into an array.
Is it possible?
Thanks!