0
我想在周一至周五的09:00至17:00之间播放一些内容。这是我迄今为止的,但它不起作用。在特定日期和时间显示内容
$current_time = idate('H');
$current_day = idate('w');
// Daytime - weekdays between 9am - 5pm
if ($current_day >= 0 || $current_day <= 4 && $current_time >= 9 || $current_time <= 17) {
// do something
}
当使用'||'和''&&内部的,如果,通常最好使用括号 – kero
'如果(($ CURRENT_DAY> = 0 || $ CURRENT_DAY <= 4)&&($ current_time> = 9 || $ current_time <= 17)){'〜在里面使用大括号来分隔条件 – RamRaider