Skip to content

Instantly share code, notes, and snippets.

@jbrooksuk
Created February 3, 2013 11:42
Show Gist options
  • Save jbrooksuk/4701443 to your computer and use it in GitHub Desktop.
Save jbrooksuk/4701443 to your computer and use it in GitHub Desktop.
Clear PHP buffers.
<?php
function flush_buffers() {
echo(str_pad("", 2048, " ")); // Fix Chrome buffers.
ob_end_flush();
@ob_flush(); // Suppress potential errors
flush();
ob_start();
}
?>
@xeoncross
Copy link

while (@ob_end_flush()); // Clear all levels of the output buffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment