介绍This module contains an interface to the iconv library functions. The iconv library functions convert strings between various character sets encodings. The supported character sets depend on the iconv() implementation on your system. Note that the iconv() function on some systems may not work as well as you expect. In this case, you should install the libiconv library. 需求Your systems standard C library must provide the iconv() function or you must have libiconv installed on your system. The libiconv library is available from http://www.gnu.org/software/libiconv/. 安装To be able to use the functions defined in this module you must compile your PHP interpreter using the configure line --with-iconv[=DIR].
运行时配置这些函数的行为受到全局配置文件 php.ini 的影响。 For further details and definition of the PHP_INI_* constants see ini_set(). 预定义常量Since PHP 4.3.0 it is possible to identify at runtime which iconv implementation is adopted by this extension. 表格 2. iconv constants
iconv_set_encodingDescriptionbool iconv_set_encoding ( string type, string charset)It changes the value of type to charset. 如果成功则返回 TRUE,失败则返回 FALSE。 The value of type can be:
iconvDescriptionstring iconv ( string in_charset, string out_charset, string str)It converts the string str encoded in in_charset to the string encoded in out_charset. It returns the converted string or FALSE, if it fails.
ob_iconv_handlerDescriptionarray ob_iconv_handler ( string contents, int status)It converts the string encoded in internal_encoding to output_encoding. internal_encoding and output_encoding should be defined by iconv_set_encoding() or in the configuration file php.ini.
|