Return to Snippet

Revision: 15885
at July 20, 2009 11:45 by 3k-


Initial 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!'); } 
}

Initial URL
http://www.v7n.com/forums/coding-forum/79591-php-loop-through-dates.html

Initial Description

                                

Initial Title
Looping through dates

Initial Tags

                                

Initial Language
PHP