The difference between flush(), ob_flush(), and ob_end_flush():
First of all, let’s talk about the buffer. It is a memory address space, which is 4096 (1kb) [in the php.ini configuration file Find the output_buffering configuration], PHP has a php output_buffering mechanism. When the PHP code is executed, it does not output the content immediately, but wants to output the echo/print content to the buffer. When the buffer is full, the data will be handed over to the system kernel. It is passed to the browser through tcp for display. When the php php output_buffering mechanism is turned on (it is turned on by default and can be turned on through the ob_start() function), only when the data in the php buffer reaches the set value, the data in the buffer will be sent to the browser.
But browsers also have caches. Some versions of browsing only output content when the data reaches 256 bytes. flush() can immediately send the content waiting to be output to the client, while ob_flush() can only wait for the buffer Output only when full.
Here is a simple example for you to verify: