3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // format in array altijd xx:yy en van laag naar hoog $time = array('07:00', '12:00', '15:00', '21:00'); $next = ''; $now = date('H:i'); foreach($time as $value) { if($now < $value) { $next = $value; break; } } if($next == '') { $next = $time[0]; } echo $next; ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
07:00