Usage analysis of ob_flush and flush functions in php, ob_flushflush. Php ob_flush function and flush function usage analysis, ob_flushflush This article analyzes the usage of the ob_flush function and flush function in php. Share it with you for your reference. Details: ob_flush function and flush function usage analysis in ob_f php, ob_flushflush
This article analyzes the usage of the ob_flush function and flush function in php. Share it with you for your reference. The details are as follows:
Ob_flush () function: extracts data from PHP buffering and places the data in server buffering.
Flush () function: extract the data of Server buffering and put it into browser buffering.
Example code:
<? Php echo str_repeat ('m0sh1', 1000); for ($ I = 0; $ I <4; $ I ++) {echo $ I .'
'; Ob_flush (); flush (); sleep (1) ;}?> <? Php // header ("content-type: text/html; charset = 'utf-8'"); // The error Cannot modify header information-headers already sent by?>
Execution discovery
Here, the code output result is output in one row,
Note: the correct sequence of use is: first ob_flush, then flush
I hope this article will help you with php programming.
In this article, we analyze the usage of the ob_flush function and flush function in php. Share it with you for your reference. Details: ob_f...