ob_list_handlers
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
ob_list_handlers — 列出所有使用中的输出处理程序。
说明
ob_list_handlers(): array
列出所有使用中的输出处理程序。
返回值
此函数将返回一个数组,数组元素是正在使用中输出处理程序名(如果存在的输出处理程序的话)。 如果启用了output_buffering 或者在 ob_start() 中创建了一个匿名函数,ob_list_handlers() 将返回 "default output handler"。
范例
示例 #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 )
参见
- ob_end_clean() - 清空(擦除)缓冲区并关闭输出缓冲
- ob_end_flush() - 冲刷出(送出)输出缓冲区内容并关闭缓冲
- ob_get_flush() - 刷出(送出)缓冲区内容,以字符串形式返回内容,并关闭输出缓冲区。
- ob_start() - 打开输出控制缓冲

User Contributed Notes
There are no user contributed notes for this page.
备份地址:http://www.lvesu.com/blog/php/function.ob-list-handlers.php