There is the following small code:

echo "<h3>Please waiting for 10 seconds...</h3>"; flush(); sleep(1); for ($i = 1; $i <= 10; $i++) { echo $i." "; flush(); sleep(1); } 

The browser first displays the inscription and the first digit, then the remaining digits with a pause between them of 1 second. I figured that out, which is why I don’t understand why the system buffer flush to the browser does not work with the first flush () command that comes after

echo "<h3>Please waiting for 10 seconds...</h3>";

  • Here php.net/manual/ru/function.flush.php in the description of the many features of the work of this function is painted. - Visman 3:49 pm
  • There I looked first of all, but I did not find the answer to my question, why in the first case the flush buffer did not work - neomax
  • Look at how my browser behaves with your script jpegshare.net/images/9d/d4/9dd4d572c6b602d912cbd6905a54b864.png The page is displayed only after 11 seconds. Prior to this empty, although the response begins faster than 10 milliseconds. - Visman
  • Ahh, this is probably because by default output_buffering is enabled on the server, I also created a .htaccess in which I wrote php_value output_buffering Off in the folder with this file - neomax
  • My script has worked as you have described, first a string is displayed, and then every second numbers. And what behavior do you expect, I did not understand a little? - Klym

0