Home  >  Article  >  Backend Development  >  utf-8怎么转成gb2312

utf-8怎么转成gb2312

WBOY
WBOYOriginal
2016-06-13 12:40:511497browse

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)显示的汉字却都变成了方框,请教该如何转换?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn