好的..所以我创造了一个混乱的问题。拉起午夜后的数据
所以,我有一个jquery滑块显示的内容5个滑动
1)-2小时前
2)-1小时前
3)(0)本
4)+1小时
5)+2小时
eac的内容h幻灯片是由一天中的什么时间决定的。然而,在试图在午夜到午夜之间尝试返回/前进1到2个小时时,整个脚本会中断并杀死该站点。
<?php
$h = date('G', strtotime ("-2 hour")); //set variable $h to the hour of the day.
$m = date('i', strtotime ("-2 hour")); //set variable $m to the min of the hour.
$d = date('w', strtotime ("-2 hour")); //set variable $d to the day of the week.
// SATURDAY SCHEDULE
if ($d == 6 && $h >= 0 && $h < 07) $file ='earlyhours.php';
else if ($d == 6 && $h >= 07 && $h < 09) $file ='breakfast.php';
else if ($d == 6 && $h >= 09 && $h < 12) $file ='throughthemorning.php';
else if ($d == 6 && $h >= 12 && $h < 13) $file ='rewind.php';
else if ($d == 6 && $h >= 13 && $h < 17 && $m <= 30) $file ='nonstop.php';
else if ($d == 6 && $h >= 17 && $m >= 30 && $h <21) $file ='livetrend.php';
else if ($d == 6 && $h >= 17 && $m >= 35 && $h < 21) $file ='nonstop.php';
else if ($d == 6 && $h >= 21 && $h < 18) $file ='gennation.php';
else if ($d == 6 && $h >= 23) $file ='earlyhours.php';
else if ($d == 7 && $h >= 0) $file ='earlyhours.php';
require $_SERVER['DOCUMENT_ROOT'] . '/collection/profiles/' . $file . '';
?>
正如你可以看到图中的时间,然后下降到正确的文件 - 有这五个一周日常(-2.php,-1.php,0.php,1.PHP ,2.php)。
有没有人有解决方案?理想情况下,我需要停止休息,但我不希望我的访问者在接近的同一天旋转+1/2或-1/2小时,并且在午夜过后。
例如,现在代码在-2.php之前打破,直到至少凌晨2点(我的时区),以便它回溯。
我已经竭尽全力想办法解决这个问题。