Each PHP script has a limited execution time, so we need to set the execution time of a script to unlimited through set_time_limit; then use flush() and ob_flush() to clear the server buffer and output the return value of the script at any time.
Such as the following script:
Copy the code The code is as follows:
header("Content-Type: text/plain");
set_time_limit(0);
$infoString = " Hello World" . "n";
while( isset($infoString) )
{
echo $infoString;
flush();
ob_flush();
sleep(5);
}
?>
The above introduces the implementation analysis of limitless furniture PHP set_time_limit0 long connection, including the content of limitless furniture. I hope it will be helpful to friends who are interested in PHP tutorials.