Code:
function create_time_range($start, $end, $interval='30 mins', $format='12'){
$startTime=strtotime($start);
$endTime=strtotime($end);
$returnTimeFormat=($format=='24')?'g:i':'G:i';
$current=time();
$addTime=strtotime('+'.$interval,$current);
$diff=$addTime-$current;
$times=array();
while ($startTime<$endTime) {
$times[]=date($returnTimeFormat,$startTime);