paulomartinhago
9/16/2013 - 11:32 AM

DateTime, DateInterval e DatePeriod

DateTime, DateInterval e DatePeriod

<?php

$start = new DateTime('2013-09-28 00:00:00');
$interval = new DateInterval('P1D');
$end = new DateTime('2013-10-04 23:59:59');
$period = new DatePeriod($start, $interval, $end);

foreach ($period as $date) {
    echo $date->format('Y-m-d') . "<br />";
}