iconv 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程

iconv

(PHP 4 >= 4.0.5, PHP 5)

iconvConvert string to requested character encoding

说明

string iconv ( string $in_charset , string $out_charset , string $str )

Performs a character set conversion on the string str from in_charset to out_charset .

参数

in_charset

The input charset.

out_charset

The output charset.

If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can't be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character.

str

The string to be converted.

返回值

Returns the converted string or FALSE on failure.

范例

Example #1 iconv() example

<?php
echo iconv("ISO-8859-1""UTF-8""This is a test.");
?>


iconv 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程