<?php
$from = new DateTime("01/01/2015");
$to = new DateTime('01/01/2016');
//Print Jan 1st through Dec 31st
for($date=clone $from; $date<$to; $date->modify('+1 day')){
echo $date->format('Y-m-d')."<br />".PHP_EOL;
}
?>
<?php
$from = new DateTime("01/01/2015");
$to = new DateTime('01/01/2016');
//Print Jan 1st through Dec 31st
for($date=clone $from; $date<$to; $date->modify('+1 day')){
echo $date->format('Y-m-d')."<br />".PHP_EOL;
}
?>
Comments