$y=date("Y",time()); $m=date("m",time()); $d=date("d",time()); $start_time = mktime(9, 0, 0, $m, $d ,$y); $end_time = mktime(19, 0, 0, $m, $d ,$y); $time = time(); if($time >= $start_time && $time <= $end_time) { // 何かをしてください.... } 复制發