The description of ob_flush/flush in the manual is that they both refresh the output buffer and need to be used together, so it will cause confusion to many people...
In fact, they operate on different objects. In some cases, flush does nothing at all. Things...
ob_* series functions operate the output buffer of PHP itself.
So, ob_flush refreshes PHP's own buffer.
Strictly speaking, flush can only be used in PHP. It only has practical effect when the apache Module (handler or filter) is installed. It refreshes the buffer of the WebServer (which can be considered to refer specifically to apache).
Under the sapi of the apache module, flush will call the flush member of sapi_module Function pointer, indirectly calls Apache's API: ap_rflush refreshes Apache's output buffer. Of course, the manual also says that there are some other Apache modules that may change the result of this action.
Some Apache modules, such as mod_gzip, may do its own output caching, which will cause the results produced by the flush() function to not be sent to the client browser immediately.
Even the browser will cache the received content before displaying it. For example, the Netscape browser caches content until it receives a newline or the beginning of an html tag, and does not display the entire table until it receives a tag.
Some versions of Microsoft Internet Explorer will only start displaying the page after receiving 256 bytes, so some extra spaces must be sent to allow these browsers to display the page content.
So, the correct order to use the two is. First ob_flush, then flush,
Of course, under other sapi, you can not call flush, but in order to ensure the portability of your code, it is recommended to use them together.
In IE, 256 bytes must be output first before it will work. The following code: