function 截取摘要($str,$length=150){ $intro= preg_replace("/\s*<.*?>\s*/","",$str); $intro=str_replace(" "," ",$intro); $intro=str_replace(" ","",$intro); $intro=str_replace("??"," ",$intro); return mb_substr($intro,0,$length)."..."; }
mb_ 开头的字符串处理函数 来处理中文 还是很方便的~