PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $start = "10:00"; $stop = "02:00"; $current_time = time(); $start_time = strtotime($start); $stop_time = strtotime($stop); // if end time less then start add one day if ($stop_time < $start_time) $stop_time += 60 * 60 * 24; echo "$start_time < $current_time < $stop_time" . PHP_EOL; if ($current_time < $start_time || $current_time > $stop_time) { die('Closed'); } echo 'Open';
Show:  
Copy Clear