php preg_replace去除html xml 注释

php preg_replace去除html xml 注释

 

//不确定是否最优
$content = preg_replace('/<!--((?!-->).)*-->/s', '', $content);

 

posted @ 2018-01-08 11:08  xiaobaicaidage  阅读(340)  评论(0编辑  收藏  举报