小风儿 发表于 2017-4-4 14:16:33

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.
页: [1]
查看完整版本: PHP编码转换函数 mb_convert_encoding 与 iconv