php preg_replace去除html xml 注释

php preg_replace去除html xml 注释

 

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

 

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