<?php $start = new DateTime('2018-12-31 00:00:00'); $interval = new DateInterval('P1M'); $recurrences = 5; $period = new DatePeriod($start, $interval, $recurrences); assert($recurrences === $period->recurrences, 'The recurrences should match.'); var_dump(array_map(function(DateTime $date) { return $date->format('Y-m-d'); }, iterator_to_array($period)));
You have javascript disabled. You will not be able to edit any code.