$content =preg_replace("/<(\/?a.*?)>/si","",$content);
$content=str_replace("办公桌", "<a href=\"http://www.weishunjj.com\" title=\"办公桌\">办公桌</a>", $content);
$content=preg_replace("/<(\/?div.*?)>/si","",$content); //过滤div标签
$content=preg_replace("/<(\/?span.*?)>/si","",$content);
来源:oschina
链接:https://my.oschina.net/u/242157/blog/3210305