Home >Backend Development >PHP Tutorial > 可在后台老板执行的PHP代码

可在后台老板执行的PHP代码

WBOY
WBOYOriginal
2016-06-13 13:09:411041browse

可在后台执行的PHP代码
ignore_user_abort();
set_time_limit(0);
$interval=10;
$i = 1;
do{
    $fp = fopen('test/text'.$i.'.txt','a');
    fwrite($fp,'test'.$i);
    fclose($fp);
    sleep($interval);
    $i++;
}while(true);

惊险的代码,关闭浏览器后程序还一直在运行,生成了N个.txt的文件..

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