Re: ob_flush() problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 31, 2006 1:29 pm, cajbecu wrote:
>     for ($i=0; $i < 10; $i++) {
>         $output = "ccc2";
>         print "<pre>";
>         echo $output;
>         print "</pre>";
>         ob_flush();
>         flush();
>
>         sleep(1);
>     }
>
> I want to show on the browser, "ccc2" (example) every 1 second, but it
> shows all the text when the for stops... any ideea?
>
> i tried all the examples from php.net, all the examples on the net,
> bot no succes.

ob_flush() only makes sense if you have ob_start() somewhere, or if
output_buffering is enabled in php.ini

flush(); and sleep(1); are all you should need...

At least from PHP standpoint.

But there are many other players outside the control of PHP...

Apache could be buffering output.

TCP could be buffering output.

Your browser will NOT render some parts of some elements until the
tags are all closed -- If you are inside a TABLE, for instance, expect
not to see things happening in real-time.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux