First of all, the two configurations in php.ini
Output_buffering Configuration
off: Indicates closing PHP output cache
on: Open an infinitely large output cache
• 4096: Open output cache with size 4096Byte (default)
Implicit_flush Configuration
on: Indicates that the flush () function is automatically called after each output (such as Echo,print), and the direct output
off: On the contrary, flush () will not be called after each output, it will need to wait until the server buffering full before output, but we can use the flush () function instead of it, not open it's OK, but more flexible
In the case of the default output_buffering=4096 and Implicit_flush=off
It is known that Chrome and the Firefox browser output cache is 1000Bytes, that only more than 1000Bytes of content will be output
Look at this procedure.
<? php for ( $i = 9; $i > 0; $i --) { str_repeat (", 122 echo $i . ' <br/> ' ; ob_flush (); flush (); sleep (1 ob_end_flush ();
Str_repeat (", 122) will be repeated 122 times space
Why is it 122?
We know that a byte takes up 8 bits 1000Bytes requires 125 characters to output it will be 126 characters
A 32-digit number of 4 characters
126-4=122
PHP output once per second