网友回复
<?php header("Content-type:text/html;charset=utf-8"); $str = "http://www.bfw.wiki/架构专题/111/如何成为架构高手.html"; echo preg_replace("/([\x{4e00}-\x{9fa5}]+)/ue",'urlencode("$1")',$str); // preg_match_all("/([\x{4e00}-\x{9fa5}]+)/u",$str,$match); // var_dump($match);