Each PHP script limits the execution time, so we need to set a script to execute indefinitely with Set_time_limit, and then use Flush () and Ob_flush () to clear the server buffer and output the return value of the script at any time.
As in the following script:
Copy the Code code 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);
}
?>
When we do, every 5 seconds, we get a row of Hello world, and if you don't press the Stop button, the browser will continue to load on one line.
Through this method, we can complete many functions, such as robot Crawler, instant message board and other programs.
The above describes the limitless furniture php set_time_limit0 long-link implementation analysis, including the limitless furniture aspects of the content, I hope that the PHP tutorial interested in a friend helpful.