Hi, I am using the following code to send a period to the browser ever second but all periods are sent at once 6 seconds later. Anyone know how I could get this script to display a one period per second? ob_start(); while($i < 6){ echo "."; $i++; sleep(1); ob_end_flush(); } ob_end_clean(); Thanks
I think you miss understood my objective. I would like to have a period printed to the browser once per second and not 6 periods 6 seconds later. If ob_flush() or ob_end_flush() is called with in the loop then I get the desired results however it only works in CLI and not in the browser. Thanks
That's exactly how I'd do it. Note you may have to output up to 1024 bytes before this, as some browsers (I can't remember which now), don't follow this kind of sequence until a minimal amount of data has passed. Jay
Actually, based on the post by Danltn and a post in another forum, adding flush(); after ob_end_flush() or after ob_flush() will do the trick in both FireFox 2 and IE 6. Thanks for everyone's help.