?
$out_string = mb_detect_encoding($string, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5")); echo $out_string;
?
这样就能知道它是什么编码的了。后续操作还可以为其转码:
?
if ($out_string == "UTF-8") { ????$string = iconv("UTF-8", "GBK", $string); }
php&获取当前字符串的编码格式
原文地址:http://blog.51cto.com/laok8/2132904