Skip to content

Instantly share code, notes, and snippets.

@davidyell
Last active October 17, 2017 10:34
Show Gist options
  • Save davidyell/60670c3f5ecc442c77fc8d6f1a340674 to your computer and use it in GitHub Desktop.
Save davidyell/60670c3f5ecc442c77fc8d6f1a340674 to your computer and use it in GitHub Desktop.
<?php
header('Content-Type:text/text');
// Disable the Nginx output buffering
header('X-Accel-Buffering: no');
ob_implicit_flush(true);
ob_end_flush();
ini_set('output_buffering', false);
for ($i = 1; $i <= 5; $i++) {
echo "$i\n";
@ob_end_flush();
@flush();
sleep(2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment