john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

buffers ob flush

<html>
<body>
<?php
#output buffer start to enable buffering
ob_start();

# google chrome does not behave correctly (sleeps the whole chunk) so workaround...
for( $i = 0 ; $i < 1024 ; $i++ )
{    echo " ";
}
# $padstr = str_pad("",1024," ");   //alternative method to print 1024 chars

echo PHP_EOL . "<br />";
echo "test" . "<br />" . PHP_EOL;

ob_flush();
flush();
sleep(2);

echo "test2" . "<br />";

ob_flush();
flush();
sleep(2);

echo "test3" . "<br />";
ob_flush();
flush();


#output buffer cleaned out/erased and disabled
ob_end_clean();

?>
<body>
</html>

  • « mysql basic notes
  • Trac wiki install on apache trac 12 »

Published

Oct 30, 2010

Category

php

~73 words

Tags

  • buffers 1
  • flush 1
  • ob 1
  • php 82