Skip to content

Instantly share code, notes, and snippets.

@AdamZWinter
Created May 12, 2020 01:14
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 AdamZWinter/865745e7e9a8f70536f97c316a616be2 to your computer and use it in GitHub Desktop.
Save AdamZWinter/865745e7e9a8f70536f97c316a616be2 to your computer and use it in GitHub Desktop.
// buffer all upcoming output
ob_start();
echo 'All done. Goodbye.';
// get the size of the output
$size = ob_get_length();
// send headers to tell the browser to close the connection
header("Content-Length: $size");
header('Connection: close');
// flush all output
ob_end_flush();
ob_flush();
flush();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment