ob_get_status()

ob_get_status() — Get status of output buffers.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

ob_get_status() returns status information on either the top level output buffer or all active output buffer levels if full_status is set to true.

Signature

ob_get_status(bool $full_status = false): array

Parameters

ParameterTypeWhat it takes
$full_statusbooltrue to return all active output buffer levels. If false or not set, only the top level output buffer is returned.

Return value

If full_status is omitted or false a simple array holding status information on the active output level is returned. If full_status is true an array with one element for each active output buffer level is returned. The output level is used as key of the top level array and each array element itself is another array holding status information on one active output level. An empty array is returned if output buffering is not turned on. ob_get_status() return array elements KeyValue name Name of active output handler (see the return values of ob_list_handlers() for details) type 0 (internal handler) or 1 (user supplied handler) flags Bitmask of flags set by ob_start(), the type of output ...

Example

The PHP manual ships no example for ob_get_status(); the signature and the parameter table above are the contract.

See also

ob_get_level(), ob_list_handlers(), ob_get_length(), ob_start()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page ob_get_status() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.