用法:
1
2
3
4
5
6
7
8
|
mb_convert_encoding( $str, $encoding1,$encoding2 );
$str,要轉換編碼文字
$encoding1,目標編碼,如utf-8,big5,大小寫均可
$encoding2,原始編碼,如UTF-8,BIG5,大小寫均可
mb_convert_encoding($str, "UTF-8"); //編碼轉換為utf-8
mb_convert_encoding($str, "UTF-8", "BIG5"); //原始編碼為BIG5轉UTF-8
mb_convert_encoding($str, "UTF-8", "auto"); //原始編碼不明,通過auto自動檢測,轉換UTF-8
|