Last active
May 5, 2016 10:01
-
-
Save agarzon/4151123 to your computer and use it in GitHub Desktop.
PHP Flush Output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
@ini_set('zlib.output_compression', 0); | |
@ini_set('output_buffering', 0); | |
@ob_end_clean(); | |
ob_implicit_flush(true); | |
for($i=0; $i<10; $i++){ | |
echo $i; | |
//this is for the buffer achieve the minimum size in order to flush data | |
echo str_repeat(' ',1024*64); | |
sleep(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment