function itime() {
//Текущее время
$currentTime = time();
$nt = date('Y:m:d:G:i:s:', $currentTime);
list($year,$month,$day, $hour, $min, $sec) = explode(':', $nt);
//Узнаём ближайший час
if ($hour >= 0 && $hour < 1) { $wayth = 1933; }
if ($hour >= 1 && $hour < 2) { $wayth = 1732; }
if ($hour >= 2 && $hour < 3) { $wayth = 1523; }
if ($hour >= 3 && $hour < 4) { $wayth = 1261; }
if ($hour >= 4 && $hour < 5) { $wayth = 964; }
if ($hour >= 5 && $hour < 6) { $wayth = 845; }
if ($hour >= 6 && $hour < 7) { $wayth = 973; }
if ($hour >= 7 && $hour < 8) { $wayth = 1057; }
if ($hour >= 8 && $hour < 9) { $wayth = 1173; }
if ($hour >= 9 && $hour < 10) { $wayth = 1257; }
if ($hour >= 10 && $hour < 11) { $wayth = 1374; }
if ($hour >= 11 && $hour < 12) { $wayth = 1436; }
if ($hour >= 12 && $hour < 13) { $wayth = 1583; }
if ($hour >= 13 && $hour < 14) { $wayth = 1683; }
if ($hour >= 14 && $hour < 15) { $wayth = 1724; }
if ($hour >= 15 && $hour < 16) { $wayth = 1763; }
if ($hour >= 16 && $hour < 17) { $wayth = 1795; }
if ($hour >= 17 && $hour < 18) { $wayth = 1832; }
if ($hour >= 18 && $hour < 19) { $wayth = 1865; }
if ($hour >= 19 && $hour < 20) { $wayth = 1925; }
if ($hour >= 20 && $hour < 21) { $wayth = 1967; }
if ($hour >= 21 && $hour < 22) { $wayth = 2184; }
if ($hour >= 22 && $hour < 23) { $wayth = 2265; }
if ($hour >= 23 && $hour >= 0){ $wayth = 2378; }
}
$array = [1933, 1732, 1523] // и дальше
function itime() {
//Текущее время
$nt = date('Y:m:d:G:i:s:', time());
list($year,$month,$day, $hour, $min, $sec) = explode(':', $nt);
$arrayTime = [1933, 1732, 1523, 1261, 1436,1436,1436,14361436,
1436,1436,1436,1436,1436,1436,1436,1436,1436,2265,22652265,2265,2265,2265];
//Узнаём ближайший час
return $arrayTime[$hour];
}
echo itime();