ascii码的汉字疑问。网上看到的一个代码
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php /**** ASCII 转 十六进制 以及 十六进制 转 ASCII* 非盈利组织或个人请放心转载,商业用途请征得作者同意**///ASCII 转 十六进制function asc2hex($str) {return '\x'.substr(chunk_split(bin2hex($str), 2, '\x'),0,-2);}//十六进制 转 ASCIIfunction hex2asc($str) {$str = join('',explode('\x',$str));$len = strlen($str);for ($i=0;$i<$len;$i+=2) $data.=chr(hexdec(substr($str,$i,2)));return $data;}$asc = "哈哈";$hex = asc2hex($asc);$asc = hex2asc($hex);echo "hex : ".$hex;echo "<br>";echo "asc : ".$asc;?>