These two days to achieve this function:
When a certain condition is reached, let the server send a message to the user, the number is more than one.
Basic idea: Linux timed scan, if you meet the conditions of the user, then send a text message.
But in order to prevent the interruption to the user, the request only during the daytime 8:00-20:00 send text messages, how to get to the daily time interval?
Please look
Copy the Code code 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 (0, 0, $m, $d, $y);
$time = time ();
if ($time >= $start _time && $time <= $end _time)
{
Do something ....
}
The above describes the timer task software PHP to get a time interval timestamp php timing task, including the timing task software aspects, I hope that the PHP tutorial interested in a friend helpful.