1$begin = new DateTime( "2015-07-03" );
2$end = new DateTime( "2015-07-09" );
3
4for($i = $begin; $i <= $end; $i->modify('+1 day')){
5 echo $i->format("Y-m-d");
6}
1$begin = new DateTime( "2015-07-03" );
2$end = new DateTime( "2015-07-09" );
3
4for($i = $begin; $i <= $end; $i->modify('+1 day')){
5 echo $i->format("Y-m-d");
6}
7
1$begin = new DateTime('2010-05-01');
2$end = new DateTime('2010-05-10');
3
4$interval = DateInterval::createFromDateString('1 day');
5$period = new DatePeriod($begin, $interval, $end);
6
7foreach ($period as $dt) {
8 echo $dt->format("l Y-m-d H:i:s\n");
9}
10