$flush = "<script type='text/javascript'> updateProgress('{$title}', $width); </script>";
echo json_encode($flush);
// get the size of the output
// $size = ob_get_length();
// send headers to tell the browser to close the connection
// header("Content-Length: $size");
// header('Connection: close');
ob_end_flush();
ob_flush();
flush();
sleep(1);
/******** background process starts here ********/
ignore_user_abort(true);//在关闭连接后,继续运行php脚本
/******** background process ********/
// set_time_limit(0); //no time limit,不设置超时时间(根据实际情况使用)
在TP5下,控制Ajax实时进度条, 不能得到flush的返回值。应该如何实现?有没有实例。 最佳答案