php 将Unicode 转成汉字

 

$v) {
		if(substr($v,0,2) == "%u")
			$ar[$k] = iconv("UCS-2","utf-8",pack("H4",substr($v,-4)));
		elseif(substr($v,0,3) == "")
			$ar[$k] = iconv("UCS-2","utf-8",pack("H4",substr($v,3,-1)));
		elseif(substr($v,0,2) == "&#") {
				$ar[$k] = iconv("UCS-2","utf-8",pack("n",substr($v,2,-1)));
			}
		}
		return join("",$ar);
	}
	echo unescape($s);
?>

  

转载于:https://www.cnblogs.com/jsoncode/p/3709368.html

你可能感兴趣的:(php)