Category Covered

Time slot between two time in php

I have two time "time from" to "time to". Now i will show how to get a interval time after certain minutes.

 Here Timeslot on 15 minutes gap.

$from = $sch['time_from'];
$to = $sch['time_to'];
						
$timePlus = '';
$i=1;
while($timePlus<=$to){
	$interval = $sch['time_slots'];
	$interval = $interval*$i;
	echo $timePlus = date('H:i:s', strtotime($from.' + '.$interval.' minutes'))."<br/>";
	$i++;
}
$p=$p+$i;