// php手册中的贡献代码:
// If you want to simulate a crontask you must call this script once and it will keep running forever (during server uptime) in the background while "doing something" every specified seconds (= $interval):
// 如果你想要模拟一个计划任务必须调用此脚本一次,它就会永远保持运行(在服务器正常运行期间)在后台做一些事情到永远,每过一个特殊的秒数 (=$interval)
ignore_user_abort(1); // run script in background
set_time_limit(0); // run script forever
$interval=60*15; // do every 15 minutes...
do{
// add the script that has to be ran every 15 minutes here
// ...
sleep($interval); // wait 15 minutes
}while(true);