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改寫下該方法,謝謝。
php5.5 preg_replace 使用e問題,改寫成preg_replace_callback
翻翻過去那場雪
2019-04-16 16:58:39