Home  >  Article  >  php教程  >  Implementation of scheduled execution tasks in PHP

Implementation of scheduled execution tasks in PHP

大家讲道理
大家讲道理Original
2016-11-09 10:09:161220browse

ignore_user_abort();//关掉浏览器,PHP脚本也可以继续执行.
set_time_limit(0);// 通过set_time_limit(0)可以让程序无限制的执行下去
$interval=60*30;// 每隔半小时运行
do{
    //这里是你要执行的代码   
    sleep($interval);// 等待5分钟
}while(true);


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
Previous article:A simple PHP collectorNext article:A simple PHP collector