[PHP] 讀檔編碼問題
mb_convert_encoding string mb_convert_encoding ( string $str , string $to_encoding [, mixed $from_encoding = mb_internal_encoding() ] ) $str,要轉換編碼文字 $to_encoding ,要轉成的編碼,如utf-8,big5,大小寫均可 $from,原始讀出來的編碼,如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
留言
張貼留言