This is very easy way loop through dates (from date to date) with PHP
strtotime() function. This example only echo dates, but of course this
model can be used more complicated situations.
<?php
// Start date
$date = '2009-12-06';
// End date
$end_date = '2020-12-31';
while (strtotime($date) <= strtotime($end_date)) {
echo "$date\n";
$date = date ("Y-m-d", strtotime("+1 day", strtotime($date)));
}
?>
No comments:
Post a Comment