PHP编码转换函数 mb_convert_encoding 与 iconv_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > PHP编码转换函数 mb_convert_encoding 与 iconv

PHP编码转换函数 mb_convert_encoding 与 iconv

 2012/5/5 12:45:42  flyer0126  程序员俱乐部  我要评论(0)
  • 摘要:stringmb_convert_encoding(string$str,string$to_encoding[,mixed$from_encoding])Returnstheencodedstring.stringiconv(string$in_charset,string$out_charset,string$str)ReturnstheconvertedstringorFALSEonfailure.Whatisthedifferencebetweeniconv(
  • 标签:iconv PHP 函数
string mb_convert_encoding( string $str , string $to_encoding [, mixed $from_encoding ] )
  Returns the encoded string.

string iconv( string $in_charset , string $out_charset , string $str )
  Returns the converted string or FALSE on failure. 

?

What is the difference between iconv() and mb_convert_encoding() in PHP?

?

iconv()
??? included with most installs of PHP.
??? when characters that can't be mapped to the new character set are found, you can specify if they are converted to a 'similar' character, or ignored.

mb_convert_encoding()

??? usually requires installing the php-mbstring extension.
??? is able to handle HTML-ENTITIES, converting to and from web hex codes.

发表评论
用户名: 匿名