<?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';
$start = "10:00";
$stop = "02:00";
$current_time = "01:01"; // $current_time = date('H:i');
$result = false;
if ($start >= $stop) {
if ($current_time >= "00:00" && $current_time <= $stop) $result = true;
if ($current_time >= $start && $current_time <= "23:59") $result = true;
} elseif ($current_time >= $start && $current_time <= $stop) {
$result = true;
}
if ($result == true) exit ("start - stop");