PHP
- 5 ответов
- 0 вопросов
3
Вклад в тег
$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");