当前位置:Gxlcms > PHP教程 > php编码转换函数(iconvmb_convert_encoding)

php编码转换函数(iconvmb_convert_encoding)

时间:2021-07-01 10:21:17 帮助过:18人阅读

  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. ?>

人气教程排行