PHP gets the timestamp of a certain period of time php scheduled task_PHP tutorial

WBOY
Release: 2016-07-21 15:19:08
Original
863 people have browsed it

In the past two days, we will implement this function:

When a certain condition is reached, let the server send multiple text messages to the user.

Basic idea: Linux scans regularly, and if there are users who meet the conditions, send text messages.

But in order to prevent disturbing users, it is required that text messages can only be sent between 8:00-20:00 during the day. How can I get this time range every day?

Please see

Copy code The code is as follows:

$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....
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325358.htmlTechArticleTo achieve this function in the past two days: When a certain condition is reached, let the server send text messages to the user, the number is Multiple. Basic idea: Linux scans regularly. If there are users who meet the conditions, send...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!