PHP 怎么将Unicode编码转换为中文字符
网页显示是中文,但查看源码是下面这样的unicode编码
PHP code
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->【GNIOUS】短袖情侣T恤 大城小爱4-时间印记-玫红 -----点击图片上的圈框,直接购买此宝贝-------
请问PHP怎么将这样代码转为中文汉字?因为要调用这些汉字做搜索字符串
------解决方案--------------------
$s = 【GNIOUS】短袖情侣T恤 大城小爱4-时间印记-玫红 -----点击图片上的圈框,直接购买此宝贝
CODE;
function foo($v) {
return iconv('ucs-2', 'gbk', pack('n', $v[1]));
}
echo preg_replace_callback('/(\d+);/', 'foo', $s);
【GNIOUS】短袖情侣T恤 大城小爱4-时间印记-玫红 -----点击图片上的圈框,直接购买此宝贝
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