1.utf8转换为gbk
header("Content-type:text/html;charset=UTF-8");echo$str='utf8转gbk!';echo'<br/>';echoiconv("UTF-8","gbk//TRANSLIT",$str);//将字符串的编码从UTF-8转到GB2312
2.gbk转utf8
header("Content-type:text/html;charset=GB2312");echo$str='gbk转utf8!';echo'<br/>';echoiconv('GB2312','UTF-8',$str);//将字符串的编码从GB2312转到UTF-8
更多内容请参考原文地址:/article/1126172331.html