一个简单的正则表达式清理不需要的字符
function setDescriptionString($inputString=""){ $replacedWords = array("…","‘","ó","<ul>","<li>","–","…"," ",""","&","“","”","<span>","</span>", "<p>","</p>", "/",":", "<", ">","<strong>", "</strong>", "<b>", "</b>", "<i>","</i>","span","strong","class","+","-","=","'","’"); $filteredString = str_replace($replacedWords, "", $inputString)."."; return $filteredString; }