I have a ajax data object that comers in with $startDate
which is Nov 12, 2013
and a $endDate
which is January 31, 2014
and I would like to create an array that looks like:
array(2013-11-12, 2013-11-13, 2013-11-14, ... , 2014-01-31);
The way I attempted to do this was:
while($startDate < $endDate){
$day = gmdate('Y-m-d', strtotime('+1 day', strtoTime($data->data['startDate'])));
$daysOfTheWeek[] = $day;
}
But the script timed out after 30 seconds. So I am wondering what the proper way to do this is.