3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $options = array(); foreach (range(0,23) as $fullhour) { $parthour = $fullhour > 12 ? $fullhour - 12 : $fullhour; $sufix = $fullhour > 11 ? " pm" : " am"; $options["$fullhour:00"] = $parthour.":00".$sufix; $options["$fullhour:30"] = $parthour.":30".$sufix; } ?>
Output for 4.3.0 - 7.1.0