Home › Forums › Back End › Loop through dates › Re: Loop through dates
March 9, 2013 at 7:19 am
#127591
Participant
$date = new DateTime(); // Without argument: now
$interval = new Dateinterval(“P1D”); // Period: 1 day
for ($i = 0; $i <= 5; $i++) {
echo $date->format(“Y-m-d”).”n”;
$date->add($interval);
}