PHPの変換、UTF-8文字エンコーディング

PHPの変換、UTF-8文字エンコーディング

関数 strToUtf8($列str ){
     $エンコード = mb_detect_encoding($ STRアレイ( "ASCII"、 'UTF-8'、 "2312"、 "GBK"、 'BIG5' ));
    もし$エンコード == 'UTF-8' ){
         リターン $列str 
    } {
         戻り mb_convert_encoding($ STR、 'UTF-8'、$エンコード)。
    } 
}

 

おすすめ

転載: www.cnblogs.com/gyfluck/p/10985478.html