Home >Backend Development >PHP Tutorial > utf-8怎么转成gb2312
utf-8如何转成gb2312
cnt是一个utf-8编码的网页通过地址传过来的参数,
用iconv和mb_convert_encoding进行转换
$cnt=iconv("utf-8","gb2312//IGNORE",$_GET['cnt']);
$cnt=mb_convert_encoding($_GET['cnt'],"gb2312","utf-8");
但var_dump($cnt)显示的汉字却都变成了方框,请教该如何转换?