array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.ob-iconv-handler.php', 1 => 'ob_iconv_handler', ), 'up' => array ( 0 => 'ref.iconv.php', 1 => 'iconv 函数', ), 'prev' => array ( 0 => 'function.iconv.php', 1 => 'iconv', ), 'next' => array ( 0 => 'book.intl.php', 1 => 'intl', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/iconv/functions/ob-iconv-handler.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)
ob_iconv_handler — 以输出缓冲处理程序转换字符编码
将字符编码从 internal_encoding
转换到 output_encoding
。
internal_encoding
和 output_encoding
应当在 php.ini 文件或 iconv_set_encoding() 中定义。
关于处理程序参数的信息,参见 ob_start()。
关于处理程序返回值的信息,参见 ob_start()。
示例 #1 ob_iconv_handler() 例子:
<?php
iconv_set_encoding("internal_encoding", "UTF-8");
iconv_set_encoding("output_encoding", "ISO-8859-1");
ob_start("ob_iconv_handler"); // 开始输出缓冲
?>