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

utf-8怎么转成gb2312

WBOY
Release: 2016-06-13 12:40:51
Original
1536 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template