I actually just made a function for that today (I think this is what you want anyways)
function getDateRange($start,$end) {
/*
* Function - Returns a list of dates from start to end as an array
*/
$process = array();
list($start_year,$start_month,$start_day) = explode("-", $start);
list($end_year,$end_month,$end_day) = explode("-", $end);
$begin = mktime(0,0,0,$start_month,$start_day,$start_year);
$finis = mktime(0,0,0,$end_month,$end_day,$end_year);
$difference = ($finis - $begin);
$difference_d = ($difference - ($difference % 86400)) / 86400;
$current_d = ($start_day);
for ($i = 0; $i <= $difference_d+1; $i++) {
$format = date("Y-m-d", mktime(0,0,0,$start_month,$current_d++,$start_year));
$process[$i] = $format;
}
return $process;
}
Both formats should be YYYY-MM-DD, it returns the dates as an array
Example:
$dates = getDateRange("2003-04-17","2003-04-20");
for ($i = 0; $i < count($dates); $i++) {
echo $dates[$i] . '<br>';
}
Will output:
2003-04-17
2003-04-18
2003-04-19
2003-04-20
Not sure if thats what you were looking for but it might help anyways 😉