php怎么把unicode转换成gb2312 不知道用iconv是否可行,帮你找了一下,http://www.newasp.net/tech/php/13333.html 这里好像有,自己没有试过,那个可能是自己实现的功能。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没弄过,iconv不行可以试试mb_顶楼主,一下 参考这个:http://blog.chinaunix.net/u/29134/showart_358931.html $str=preg_replace("/\\\u(.{4})/","\".unicode2gb2312('\\1').\"",$str);$str = "\$str=\"$str\";";eval($str);print $str;print unicode2gb2312("7D20");function unicode2gb2312($str) {// $bs = split('\u',$str); $bs=$str; $c = "";// for($i = 1; $i < count($bs); $i++) { $c .= chr(hexdec(substr($bs,2))); $c .= chr(hexdec(substr($bs,0,2)));// } $c = iconv('UTF-16', 'GB2312', $c);// echo $c; return $c;} 时区问题 PHP小偷程序 为什么翻页的参数传不过来啊 一个正则表达式问题 请教关于php中点击“确定”后调用.sh程序的问题 有一个横向循环不会写了 ereg(): REG_ECTYPE这个是什么问题? 怎样用PHP获得客户端地址栏输入的域名的主机头名? 求教:能不能动态修改html(php)文件的内容,并能保存? 找兼职的PHP工作! 问题很严重!正则长度 求php图片验证码 点击可刷新那种
$str = "\$str=\"$str\";";eval($str);
print $str;
print unicode2gb2312("7D20");
function unicode2gb2312($str) {
// $bs = split('\u',$str);
$bs=$str;
$c = "";
// for($i = 1; $i < count($bs); $i++) {
$c .= chr(hexdec(substr($bs,2)));
$c .= chr(hexdec(substr($bs,0,2)));
// }
$c = iconv('UTF-16', 'GB2312', $c);
// echo $c;
return $c;
}