- print_r: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$start = strtotime('00:00am');
$end = strtotime('23:00am');
$range = array();
while ($start !== $end)
{
$start = strtotime('+30 minutes',$start);
$range[] = date('h:ia', $start);
}
print_r($range);