//判断编码
$encode = mb_detect_encoding($q, array('GB2312','GBK','UTF-8'));echo $encode."<br/>";if($encode=="GB2312"){ $q = iconv("GBK","UTF-8",$q);}