1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. php中的字符編碼轉換函數的用法

        時間:2020-11-16 11:18:21 PHP 我要投稿

        php中的字符編碼轉換函數的用法

          一般來說,在網頁程序中,尤其是涉及到數據庫的`讀出過程中,往往最惱火的就是字符編碼的問題,php4.0.6以上的版本提供了mb_convert_encoding 可以方便的轉換編碼。

          具體如下:

          復制代碼 代碼如下:<?php

          /* Convert internal character encoding to SJIS */

          $str = mb_convert_encoding($str, "SJIS");

          /* Convert EUC-JP to UTF-7 */

          $str = mb_convert_encoding($str, "UTF-7", "EUC-JP");

          /* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */

          $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");

          /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */

          $str = mb_convert_encoding($str, "EUC-JP", "auto");

          ?>

          比如要把gb2312的字符串轉為utf-8的,可以用如下方法:

          復制代碼 代碼如下:$str=mb_convert_encoding($str,"UTF-8","GB2312")

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>