Last active
January 4, 2016 05:29
-
-
Save gorillamoe/8575579 to your computer and use it in GitHub Desktop.
PHP echo out immediately.
This file contains 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 | |
// quick hack, because many browsers need a certain amount of body size | |
// to be printed in the first place before flush will have an effect | |
while (ob_get_level()) ob_end_flush(); | |
// implicit flush, so we don't have to call flush all the time | |
ob_implicit_flush(true); | |
for ( $i = 0; $i < 113377; $i++ ) { | |
// gets immediately echo'd out | |
echo "this is $i\n\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment