Home  >  Article  >  Backend Development  >  PHP code to obtain the timestamp of a certain period of time and send letters regularly

PHP code to obtain the timestamp of a certain period of time and send letters regularly

WBOY
WBOYOriginal
2016-07-25 09:04:50871browse
  1. $y=date("Y",time());

  2. $m=date("m",time());
  3. $d=date("d",time());
  4. $start_time = mktime(9, 0, 0, $m, $d ,$y);
  5. $end_time = mktime(19, 0, 0, $m, $d ,$y);

  6. $time = time();

  7. if($time >= $start_time && $time <= $end_time)
  8. {
  9. // do something....
  10. }

复制代码


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn