0
我需要做一個網站重定向到21.45到10.00之後的網頁 我需要一個腳本,可以在特定時間將網站重定向到另一個頁面。我需要做一個網站重定向到21.45到10.00之後
這是發生了什麼事。
<?php
$date = new DateTime('now');
$date->setTimezone(new DateTimeZone('Europe/Athens'));
if ($date->format('H')>=10 && $date->format('H')<=21 ){
if ($date->format('H')==21 && $date->format('i')<45)
echo "<script>window.location = '/'</script>";
else if($date->format('H')<21)
echo "<script>window.location = '/'</script>";
}
?>
非常感謝你)) –