1 ignore_user_abort();
//关掉浏览器,PHP脚本也可以继续执行.
2 set_time_limit(0);
// 通过set_time_limit(0)可以让程序无限制的执行下去
3 $interval=6*0.1;
// 每隔0.6秒
4 $i=1
;
5 include 'db.php'
;
6 $db=
new db();
7 die;
8 do{
9 $run =
include 'config.php'
;
10 #判断值
11 if(!
$run)
die('process abort'
);
12 #sql
13
14 $sql="insert into one values(null,".
date('h:i:s').")"
;
15 $db->uidRst(
$sql);
16 sleep(
$interval);
// 让程序睡0.6秒
17 }
while(
true);
转载于:https://www.cnblogs.com/hgj123/p/4062090.html
相关资源:探讨:关闭浏览器后,php脚本会不会继续运行