3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["start" => "Mon 09:30", "end" => "Mon 11:00"], ["start" => "Sun 14:10", "end" => "Sun 20:00"], ["start" => "Sun 07:30", "end" => "Sun 08:00"], ["start" => "Sun 08:30", "end" => "Sun 09:30"] ]; function in_range($array) { $now = time(); // using server timezone echo date("D H:i") , "\n"; foreach ($array as $range) { if ($now >= strtotime($range["start"]) && strtotime($range["end"]) >= $now) { return $range; // or true if you like } } return false; } var_export(in_range($array));
Output for git.master, git.master_jit
Sun 13:28 false

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
18.23 ms | 405 KiB | 5 Q