Home >Backend Development >PHP Tutorial >Implementation of scheduled execution tasks in PHP_PHP tutorial

Implementation of scheduled execution tasks in PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:48:37684browse

Functions used ignore_user_abort(),set_time_limit(0),sleep($interval)

Just run this code once and then close the browser.

​ignore_user_abort();//Close the browser and the PHP script can continue to execute.

​set_time_limit(0); // Through set_time_limit(0), the program can be executed without limit

​$interval=60*30;//Run every half hour

​do{

// www.2cto.com Here is the code you want to execute

sleep($interval);//wait 5 minutes

}while(true);

http://itsafe.org/?p=456

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478420.htmlTechArticleThe functions used ignore_user_abort(),set_time_limit(0),sleep($interval) This code only needs to be run once Just close the browser. ignore_user_abort();//Close the browser, PHP scripts can also be used...
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