publicfunctionentity_decode($str,$charset='UTF-8'){if(stristr($str,'&')===FALSE){return$str;}$str=html_entity_decode($str,ENT_COMPAT,$charset);$str=preg_replace('~(0*[0-9a-f]{2,5})~ei','chr(hexdec("\\1"))',$str);returnpreg_replace('~([0-9]{2,4})~e','chr(\\1)',$str);}麻烦使用preg_replace_callback改写下该方法,谢谢。
江户川乱折腾
相关分类