首頁  >  文章  >  後端開發  >  php編碼轉換函數(iconv mb_convert_encoding)

php編碼轉換函數(iconv mb_convert_encoding)

WBOY
WBOY原創
2016-07-25 08:53:58859瀏覽
  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