Ob_flush function and flush function usage analysis in PHP, Ob_flushflush
This paper analyzes the usage of Ob_flush function and flush function in PHP. Share to everyone for your reference. Specific as follows:
Ob_flush () function: Take out the data in PHP buffering and put it into the server buffering
Flush () Function: Remove the data from the server buffering and put it into browser buffering
For example, code:
<?php Echo str_repeat (' m0sh1 ', +); for ($i =0; $i <4; $i + +) { echo $i. '
'; Ob_flush (); Flush (); Sleep (1); } ?> <?php//header ("content-type:text/html;charset= ' Utf-8 '"); Hint error cannot modify header Information-headers already sent by?>
Perform discovery
Here the code output is one line of output,
Note: The order in which they are used correctly is. Ob_flush first, then flush.
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/969496.html www.bkjia.com true http://www.bkjia.com/PHPjc/969496.html techarticle Ob_flush function and flush function usage analysis in PHP, Ob_flushflush the Ob_flush function and the usage of flush function in PHP. Share to everyone for your reference. Specific as follows: Ob_f ...