Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

ob_list_handlers

Description

The ob_list_handlers of Output Control for PHP list all output handlers in use.

Syntax

ob_list_handlers(): array

Parameters

Return

This will return an array with the output handlers in use (if any). If output_buffering is enabled or an anonymous function was used with ob_start(), ob_list_handlers() will return "default output handler".

Examples

1 · return

<?

ob_start();

$return = ob_list_handlers();

print_r($return);

?>
Array
(
    [0] => default output handler
    [1] => default output handler
)

2 · return · output_buffering enabled

<?

$return = ob_list_handlers();

print_r($return);

?>
Array
(
    [0] => default output handler
)

3 · return · gzip

<?

$callback = 'ob_gzhandler';

ob_start($callback);

$return = ob_list_handlers();

print_r($return);

?>
Array
(
    [0] => default output handler
    [1] => ob_gzhandler
)

4 · return · anonymous

<?

$callback = function($string)
{
    return $string;
};

ob_start($callback);

$return = ob_list_handlers();

print_r($return);

?>
Array
(
    [0] => default output handler
    [1] => Closure::__invoke
)

5 · return · rewrite

<?

$name = 'name';
$value = 'value';
output_add_rewrite_var($name, $value);

$return = ob_list_handlers();

print_r($return);

?>
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
HomeMenu