Skip to content

Instantly share code, notes, and snippets.

@hugsbrugs
Created December 18, 2015 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugsbrugs/bac6994a8823b572a712 to your computer and use it in GitHub Desktop.
Save hugsbrugs/bac6994a8823b572a712 to your computer and use it in GitHub Desktop.
PHP flush example
<?
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
/* permet d'aficher le contenu d'une page au fur et à mesure ... très bon pour le dev ou quand on veut suivre un process */
header( 'Content-Encoding: none; ' );//disable apache compressed
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
ob_implicit_flush(1);
echo str_repeat(" ", 1024), "\n"; flush();
echo 'Begin ...
';
for( $i = 0 ; $i < 100 ; $i++ )
{
echo $i . '
';
flush();
ob_flush();
sleep(1);
}
echo 'End ...
';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment