php获得某段时间区间的时间戳并定时发信的代码
时间:2021-07-01 10:21:17
帮助过:26人阅读
$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)
- {
- // do something....
- }
|