I have this code: for ($i = 0; $i <= 31; $i++) { echo $i; @flush(); @ob_flush(); sleep(1); } PHP: I cannot manage to output each number, one by one, not all at once? Thanks!
Try this: <?php header( 'Content-type: text/html; charset=utf-8' ); ob_start(); for ($i = 0; $i <= 10; $i++) { echo $i . "<br />"; flush(); ob_flush(); sleep(1); } ob_end_flush(); ?>
Not working. It displays the result all at once. Adding php_value output_buffering "0" results in a 500 error.
Please make sure to refresh a few times if the page is already stored in your cache... tested on both Chrome and IE9 and works for me here http://www.risharde.com/test/test-flush.php
Okay, please refer to http://www.php.net/manual/en/function.ob-flush.php if you have not already done so and read the user comments for other possible solutions.
I've tested them all. Now I read again to make sure I really tested all. Still, nothing seems to work.
If you're using cPanel, you might want to find out how to define variables via your php.ini. Also I read you might need to disable gzip compression. That's the best I can do from this side to help you. Hope you get through with it
In php.ini I have output_buffering = Off zlib.output_compression = Off implicit_flush = Off In php file I have header( 'Content-type: text/html; charset=utf-8' ); echo 'Begin ...<br />'; for( $i = 0 ; $i < 10 ; $i++ ) { echo $i . '<br />'; ob_flush(); flush(); ob_flush(); sleep(1); } echo 'End ...<br />'; PHP: Still not working..
Yup, I did try with your code too. Here it is with your code in the php file: http://seomods.co.uk/search1.php