Welcome Guest, Not a member yet? Register   Sign In
What does ob_get_level() > $this->ob_level + 1 mean?
#1

I know it might be a naive question, but I've found this piece of code in the Exceptions.php file and (with all the online documentation) I can't find a way to understand what this means.

PHP Code:
if (ob_get_level() > $this->ob_level 1)
        {
            
ob_end_flush();
        } 
I know it is something about "PHP output buffering mechanism", but it still doesn't make any sense to me.

Any help will be much appreciated.
Reply
#2

This is bone-standard part of PHP provision for capturing output.
http://php.net/manual/en/book.outcontrol.php
Reply
#3

The Introduction page on Output Control in the PHP manual states:

Quote:The Output Control functions allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has begun outputting data. The Output Control functions do not affect headers sent using header() or setcookie(), only functions such as echo and data between blocks of PHP code.


You may find this article makes the above statement clear.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB