Source: http://php.net/manual/en/function.ob-flush.php
some problems with ob_flush() and flush() could be resolved by defining content type header :
header( ‘Content-type: text/html; charset=utf-8’ );
so working code looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 |
<?php header( 'Content-type: text/html; charset=utf-8' ); echo 'Begin ...<br />'; for( $i = 0 ; $i < 10 ; $i++ ) { echo $i . '<br />'; flush(); ob_flush(); sleep(1); } echo 'End ...<br />'; ?> |