您的位置:首页 > 其它

【基础知识】iconv的第二个参数的两个后缀

2012-08-16 23:23 232 查看
例如:

Example #1 [b]iconv() example[/b]

<?php

$text = "This is the Euro symbol '€'.";

echo 'Original : ', $text, PHP_EOL;

echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL;
//将不能直接转化的字符变成一个或多个近似的字符echo 'IGNORE   : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL;
//会忽略掉不能转化的字符

echo 'Plain    : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;

?>


The above example will output something similar to:

Original : This is the Euro symbol '€'.
TRANSLIT : This is the Euro symbol 'EUR'.
IGNORE   : This is the Euro symbol ''.
Plain    :
Notice: iconv(): Detected an illegal character in input string in .\iconv-example.php on line 7

This is the Euro symbol '


参考: http://www.daxuesheng.net/index.php/Index/article/id/1116
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: