Hemşerim birazdan çözümü paylaşayım.

Şuan kodunu yazıyorum.
edit: uykum geldi heralde benim olayı çözemedim test için ufak bi betik yazdım işinize yarayabilir.
<?php
function check($start, $end) {
$_timestamp_now = strtotime(date('H:i'));
$_timestamp_start = strtotime($start);
$_timestamp_end = strtotime($end);
/* var_dump([
'a' => ($_timestamp_now >= $_timestamp_start),
'b' => ($_timestamp_now <= $_timestamp_end),
'c' => ($_timestamp_now >= $_timestamp_start) || ($_timestamp_now <= $_timestamp_end),
'd' => ($_timestamp_now >= $_timestamp_start) && ($_timestamp_now <= $_timestamp_end),
'e' => ($_timestamp_start >= $_timestamp_end),
'f' => ($_timestamp_end >= $_timestamp_start),
'g' => ($_timestamp_start <= $_timestamp_end),
'h' => ($_timestamp_end <= $_timestamp_start),
($_timestamp_now <= $_timestamp_end)
]);*/
if($_timestamp_start >= $_timestamp_end) {
$timestamp_now = strtotime(date('d.m.Y H:i'));
$timestamp_start = strtotime(sprintf('%s %s', date('d.m.Y'), $start));
$timestamp_end = strtotime(sprintf('%s.%s %s', (date('d') + 1), date('m.Y'), $end));
echo substr(date('H', $timestamp_end), 0, 1);
if(substr(date('H', $timestamp_end), 0, 1) != '0')
return false;
else if($timestamp_now <= $timestamp_start)
return false;
else if($timestamp_now >= $timestamp_end)
return false;
else
return true;
} else {
$timestamp_now = strtotime(date('d.m.Y H:i'));
$timestamp_start = strtotime(sprintf('%s %s', date('d.m.Y'), $start));
$timestamp_end = strtotime(sprintf('%s.%s %s', (date('d') + 1), $end));
if($timestamp_now <= $timestamp_start)
return true;
else if($timestamp_now >= $timestamp_end)
return true;
else
return false;
}
# return (($_timestamp_now >= $_timestamp_start) || ($_timestamp_now <= $_timestamp_end)) ? true : false;
}
# check("22:00", "21:00");
# check("22:00", "04:00");
// echo check("22:00", "04:00");
if(check("22:00", "04:00"))
echo 'saat aralığı içinde!';
else
echo 'saat aralığı dışında!';