I stumbled upon this thread looking to do the same thing and although this thread is a bit old, but I thought I'd drop in my two cents.
I was able to accomplish the same thing like this:
PHP Code:
$start_date = '2008-03-01';
$check_date = $start_date;
$end_date = '2008-03-14';
while ($check_date != $end_date) {
$check_date = date ("Y-m-d", strtotime ("+1 day", strtotime($check_date)));
echo $check_date . '<br>';
}
You'll probably want to build some error checking into this so you don't create an infinite loop, something like the following would work:
PHP Code:
$start_date = '2008-03-01';
$check_date = $start_date;
$end_date = '2008-03-14';
$i = 0;
while ($check_date != $end_date) {
$check_date = date ("Y-m-d", strtotime ("+1 day", strtotime($check_date)));
echo $check_date . '<br>';
$i++;
if ($i > 31) { die ('Error!'); }
}
From here you would use $check_date to do what you want. Of course you can format these dates anyway you wish thanks to the wonderful php date() function.
Luke