Results 1 to 3 of 3

Thread: Multiple ob_starts?

  1. #1
    Join Date
    Dec 2007
    Location
    Stranded in Sarasota Florida
    Posts
    75
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Question Multiple ob_starts?

    I need to do two ob_starts....
    ob_start("ob_gzhandler");
    ob_start("sehl");
    If we're not allowed two how do we merge them?

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    PHP Code:
    function callback($buffer) {
    $buffer ob_gzhandler($buffer);
    $buffer sehl($buffer);
    return 
    $buffer;
    }

    ob_start('callback'); 
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You can find the explanation from php.net

    "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." more..

    According to this explanation it is allowed to maintain more than one output buffers.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •