Forum Moderators: coopster

Message Too Old, No Replies

Multiple callback_outputs for ob_start

How can i get more then 1 function to ob_start()?

         

BlackDex

10:45 am on Dec 2, 2005 (gmt 0)

10+ Year Member



Hello ppl,

I Have a question about ob_start().

How can i add more callback_outputs to ob_start?

I want to have both:
ob_start('switchContent');
and
ob_start('ob_gzhandler');

Who can i do that?

Thx in advanced.

BlackDex

9:06 pm on Dec 2, 2005 (gmt 0)

10+ Year Member



Have looked on google and yahoo etc..
But i can't find anything at all.

Does someone have any idea?

coopster

4:30 pm on Dec 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active. Just make sure that you call ob_end_flush() the appropriate number of times. If multiple output callback functions are active, output is being filtered sequentially through each of them in nesting order.

ob_start() [php.net]

BlackDex

8:53 pm on Dec 5, 2005 (gmt 0)

10+ Year Member



So

ob_start('ob_gzhandler');
ob_start('switchContent');

//PHP CODE HERE

ob_end_flush(); //ob_gzhandler
ob_end_flush(); //switchContent

Would work :D.

Ah... thx..
Ill go try that at work.

Thx