<?php
// get current time and round it to next half hour
$start = (intdiv(time(),(30 * 60)) + 1) * (30*60);
console.log('----$start',$start );
$end = strtotime('02:00');
console.log('----$end',$end );
// if end time less then start add one day
if ($end < $start) $end += 60 * 60 * 24;
while ($start <= $end) {
echo date('H:i',$start) . PHP_EOL;
// Increment Start date
$start += (5*60);
}