首页 >后端开发 >php教程 >php编码转换函数(iconv mb_convert_encoding)

php编码转换函数(iconv mb_convert_encoding)

WBOY
WBOY原创
2016-07-25 08:53:58883浏览
  1. echo iconv("ISO-8859-1", "UTF-8", "This is a test.");
  2. ?>
复制代码

2,mb_convert_encoding函数语法 :

  1. /* Convert internal character encoding to SJIS */

  2. $str = mb_convert_encoding($str, "SJIS");
  3. /* Convert EUC-JP to UTF-7 */

  4. $str = mb_convert_encoding($str, "UTF-7", "EUC-JP");
  5. /* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */

  6. $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");
  7. /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */

  8. $str = mb_convert_encoding($str, "EUC-JP", "auto");
  9. ?>
复制代码


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn