Hello,
I have a problem to get unique values from dateperiod-loop.
There is a tons of examples how to do it, but after hours of searching, i couldn't find suitable solution for me.
The code starts like this. To put it into array_unigue is hard to accomplish for me.
Have you any simple proposals to make it working?
$intrvl = strtotime("1970-01-01 00:30:00 UTC");
$dateTimes = new DatePeriod(
new DateTime($starttime),
new DateInterval('PT'.$intrvl.'S'),
new DateTime($endtime)
);
foreach ($dateTimes as $dt) {
$start=$dt->format('H.i');
$end=date('H.i',strtotime('+30 minutes',strtotime($start)));
echo'<div>'.$start.' - '.$end.'</div>';
}