php preg_replace去除html xml 注释

php preg_replace去除html xml 注释

//不确定是否最优
$content = preg_replace('/<!--((?!-->).)*-->/s', '', $content);
原文地址:https://www.cnblogs.com/8000cabbage/p/8241684.html