Last active
January 14, 2016 18:29
-
-
Save ghacosta/732a6b51a05d634b15b2 to your computer and use it in GitHub Desktop.
enabling echo in real time flushing buffer.
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 | |
// Turn off output buffering | |
ini_set('output_buffering', 'off'); | |
// Turn off PHP output compression | |
ini_set('zlib.output_compression', false); | |
//Flush (send) the output buffer and turn off output buffering | |
while(@ob_end_flush()); | |
// Implicitly flush the buffer(s) | |
ini_set('implicit_flush', true); | |
ob_implicit_flush(true); | |
// Needed to force browsers to actually display data | |
echo str_pad("",1024," "); | |
echo "<br />"; | |
ob_implicit_flush(true); | |
for($i=1; $i<=10; $i++){ | |
//if wants to clear screen | |
//ob_end_clean(); | |
echo "$i ...<br>"; | |
sleep(1); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment