0
点赞
收藏
分享

微信扫一扫

PHP编码转换函数 mb_convert_encoding 与 iconv


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.


举报

相关推荐

0 条评论