我有用于循环的PHP脚本,它应该循环遍历代码然后退出,但这些没有发生,它一直循环直到我手动退出。
我的代码
<?php
session_start();
?>
<?php
ignore_user_abort(true);
for( $x=0; $x< 50; )
{
$_SESSION['timeout'] = time();
$st = $_SESSION['timeout'] + 1;
session_unset();
$_SESSION['timeout'] = time();
$st = $_SESSION['timeout'] + 1;
print_r("$st\n");
}
if(time() < $st)
{
file_put_contents('/tmp/phptest1234.txt', 'test');
}
?>
答案 0 :(得分:0)