PHP如何將字符串轉(zhuǎn)換成utf-8編碼?具體代碼如下:
// Fixes the encoding to uf8
function fixEncoding($in_str)
{
$cur_encoding = mb_detect_encoding($in_str) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
return $in_str;
else
return utf8_encode($in_str);
} // fixEncoding
更多信息請(qǐng)查看IT技術(shù)專欄