Output Control 函数
在线手册:中文 英文
PHP手册

ob_list_handlers

(PHP 4 >= 4.3.0, PHP 5)

ob_list_handlers列出所有使用中的输出处理程序。

说明

array ob_list_handlers ( void )

列出所有使用中的输出处理程序。

返回值

此函数将返回一个数组,数组元素是正在使用中输出处理程序名(如果存在的输出处理程序的话)。 如果启用了output_buffering 或者在 ob_start() 中创建了一个匿名函数,ob_list_handlers() 将返回 "default output handler"。

范例

Example #1 ob_list_handlers() example

<?php
//using output_buffering=On
print_r(ob_list_handlers());
ob_end_flush();

ob_start("ob_gzhandler");
print_r(ob_list_handlers());
ob_end_flush();

// anonymous functions
ob_start(create_function('$string''return $string;'));
print_r(ob_list_handlers());
ob_end_flush();
?>

以上例程会输出:

Array
(
    [0] => default output handler
)

Array
(
    [0] => ob_gzhandler
)

Array
(
    [0] => default output handler
)

参见


Output Control 函数
在线手册:中文 英文
PHP手册