Many do not say, directly on the code:
Copy CodeThe code is as follows:
Ignore_user_abort (TRUE); Set whether the execution of the script is interrupted when the client disconnects
Set_time_limit (0);
$file = '/tmp/ignore_user.txt ';
if (!file_exists ($file)) {
File_put_contents ($file);
}
if (! $handle = fopen ($file, ' a+b ')) {
echo "Not open File:". $file;
Exit
}
$i = 0;
while ($i <100) {
$time = Date ("Y-m-d h:i:s", Time ());
echo $time. " \ n ";
if (fwrite ($handle, $time. " \ n ") ===false) {
echo "Not write File:". $file;
Exit
}
echo "Write file time:" $time. " \ n ";
$i + +;
Sleep (2);
}
Fclose ($handle);
http://www.bkjia.com/PHPjc/325782.html www.bkjia.com true http://www.bkjia.com/PHPjc/325782.html techarticle Many do not say, directly on the code: Copy code code as follows: Ignore_user_abort (TRUE);//Set whether the client disconnects when the execution of the script set_time_limit (0); $file = '/tmp/ig ...