Ec (2); PHP program buffer, regardless of the circumstances in which PHP is executed (CGI, web server, etc ). This function sends all the output of the program so far to the user's browser. The flush () function does not affect the cache mode of the server or client browser. Therefore, you must use both the ob_flush () and flush () functions to refresh the output buffer. Some web server programs, especially the web server programs under Win32, will still cache the script ec (2) before sending the results to the browser;
The buffer of the PHP program, regardless of the circumstances in which PHP is executed (CGI, web server, etc ). This function sends all the output of the program so far to the user's browser.
The flush () function does not affect the cache mode of the server or client browser. Therefore, you must use both the ob_flush () and flush () functions to refresh the output buffer.
Some web server programs, especially the web server programs under Win32, will cache the Script output until the program ends before sending the results to the browser.
*/
For ($ I = 10; $ I> 0; $ I --)
{
Echo $ I;
Ob_flush ();
Flush ();
Sleep (1 );
}
// Microsoft Internet Explorer displays the page only after receiving the 256 bytes. Therefore, some extra spaces must be sent for these browsers to display the page content.
// Normal usage
Ob_start ();
Ob_end_flush ();
For ($ I = 1; $ I <= 300; $ I ++) echo 'www.111cn.net ';
$ I = 0;
While (1 ){
Echo $ I;
Sleep (1 );
$ I ++;
}
For ($ I = 0; $ I <10; $ I ++ ){
Echo $ I;
Flush ();
Sleep (1 );
}
// This code should output $ I every second, but not necessarily in reality. In IE, it may be that after 10 seconds, all the output will be displayed at the same time.
// Ob_end_flush (); // IE8 does not work
Echo str_pad ("", 256); // IE must receive 256 bytes before display starts
For ($ I = 0; $ I <18; $ I ++ ){
Echo $ I;
Flush ();
Sleep (1 );
}