我已经试了下面多种方式,要么是乱码,要么就报错。
$strInput = "李奡 ad ss ";
//输出正常,无乱码
echo $strInput;
//报错:iconv(): Unknown error
echo iconv('utf-8','gb2312',$strInput);
//乱码
echo iconv('utf-8','gb2312//IGNORE',$strInput);
//乱码
echo iconv('utf-8','GBK',$strInput);
//乱码
echo mb_convert_encoding($strInput,"GBK","UTF-8");
//乱码
echo mb_convert_encoding($strInput,"GBK");
九州编程