- var_export: documentation ( source)
- range: documentation ( source)
<?php
$period = new DatePeriod(
new DateTime('2018-12-15'),
new DateInterval('P1D'),
new DateTime('2018-12-31'),
DatePeriod::INCLUDE_END_DATE
);
foreach ($period as $date) {
$years[$date->format('Y')][$date->format('m')][$date->format('d')] = range(0, 23);
}
var_export($years);