Flush() doesn't work.

I’ve tried many different ways to get this script to work. Instead of outputting as desired, it outputs all at once after the script has finished.
[php]<?php
ob_end_flush();
//A simple while loop that outputs once a second for 15 seconds

$counter = 0;
while($counter <15){
echo ‘~~~~~
’;
$counter++;
@ob_flush();
sleep(1);
}
?>
[/php]

I also have implicit_flush set to 1 in php5.ini. I’m using godaddy shared linux hosting economy plan. I don’t know exactly what php version they use and the apache version. They have TERRIBLE documentation about php on their website.

Thanks for your comments.

try

ob_get_contents(); ob_clean();

instead of flush();

Sponsor our Newsletter | Privacy Policy | Terms of Service