使用解码
html_entity_depre或使用删除它们
preg_replace:
$Content = preg_replace("/&#?[a-z0-9]+;/i","",$Content);编辑:根据雅科的评论的替代
用{2,8}或其他内容替换’+’可能会很好。当出现未编码的“&”时,这将限制替换整个句子的机会。
$Content = preg_replace("/&#?[a-z0-9]{2,8};/i","",$Content);
使用解码
html_entity_depre或使用删除它们
preg_replace:
$Content = preg_replace("/&#?[a-z0-9]+;/i","",$Content);编辑:根据雅科的评论的替代
用{2,8}或其他内容替换’+’可能会很好。当出现未编码的“&”时,这将限制替换整个句子的机会。
$Content = preg_replace("/&#?[a-z0-9]{2,8};/i","",$Content);