Some times getting NAN error and total minures divisible by prime getting invalid output
Any body help me

 <html>
<head>
</head>
<body>
<!DOCTYPE html>
  <?php  $event_time = "9:30 am";
         $end_time="11:00 am";
         $event_length1 = "25";
         $event_length=(int)$event_length1;
echo $event_time."<br>";
echo $end_time."<br>";
     $dtime_1 = new Datetime($event_time);
$dtime_2 = new Datetime($end_time);
$diff = $dtime_1->diff($dtime_2);
$hourone=$diff->format('%H');
$minuteone=$diff->format('%I');

$totalhour=$hourone*60;
$totalmin1=$totalhour+$minuteone;
$totalmin=(int)$totalmin1;
echo $totalmin.'<br>';
echo $event_length.'<br>';
$time_block=(int)$totalmin / $event_length;
echo $time_block;
/*$time_block=$totalmin/$event_length;
*/
     // minutes
    for($i = 0, $eTime = strtotime($event_time);$i <= $time_block;$i++, $eTime = strtotime("+$event_length minutes", $eTime))
    {
    $new_event_time = date('H:i', $eTime);
    echo "<p>$new_event_time</p>\n";
    }

    ?>
    </body>
</html>

</body>
</html>