Yes and no.
There are three output buffers you need to worry about:
- PHP can output a buffer. You can use the ob_ functions to manage this buffer and force the exit to apache / iis (web server).
- Apache / IIS have their own buffers and will only send information when they consider that they are enough to send. It is also complemented by mod_gzip or other compression. You cannot control this through PHP.
- There are also potentially other caches / proxies between the browser and the server. They MAY hold the exit until he gets the full answer.
So echo immediately puts it in the PHP buffer. You can send the buffer to the web server, but after that it is out of your hands.
source share