ob_get_status
Description
The ob_get_status of Output Control for PHP get status of output buffers.
Syntax
ob_get_status( bool $full_status = false ): array
Parameters
full_status
true to return all active output buffer levels. If false or not set, only the top level output buffer is returned.
Return
If called without the full_status parameter or with full_status = false a simple array with the following elements is returned:
Key | Value |
---|---|
level | Output nesting level |
type | 0 (internal handler) or 1 (user supplied handler) |
status | One of PHP_OUTPUT_HANDLER_START (0), PHP_OUTPUT_HANDLER_CONT (1) or PHP_OUTPUT_HANDLER_END (2) |
name | Name of active output handler or 'default output handler' if none is set |
del | Erase-flag as set by ob_start() |
If called with full_status = 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. The full output contains these additional elements:
Key | Value |
---|---|
chunk_size | Chunk size as set by ob_start() |
size | ... |
blocksize | ... |
Examples
1 · void
<? ob_start(); $return = ob_get_status(); print_r($return); ?>
Array ( [name] => default output handler [type] => 0 [flags] => 112 [level] => 1 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 0 )
2 · full_status · false
<? ob_start(); $full_status = false; $return = ob_get_status($full_status); print_r($return); ?>
Array ( [name] => default output handler [type] => 0 [flags] => 112 [level] => 1 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 0 )
3 · full_status · true
<? ob_start(); $full_status = true; $return = ob_get_status($full_status); print_r($return); ?>
Array ( [0] => Array ( [name] => default output handler [type] => 0 [flags] => 112 [level] => 0 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 0 ) [1] => Array ( [name] => default output handler [type] => 0 [flags] => 112 [level] => 1 [chunk_size] => 0 [buffer_size] => 16384 [buffer_used] => 0 ) )