I have these for loop code that loop time and increase minute by 20+ minutes.
But I want to include also the starting time. Somehow it’s missing in the output.
My current code :
$slot_count = 5;
$start = strtotime("08:00");
for( $i=0; $i<$slot_count; $i++ )
{
$start = $start;
$end_new = date("H:i:s", strtotime('+20 minutes', $start));
$start = strtotime($end_new);
echo ''.$end_new.'<br/>';
}
Current output :
08:20:00
08:40:00
09:00:00
09:20:00
09:40:00
Expected output :
08:00:00
08:20:00
08:40:00
09:00:00
09:20:00
09:40:00