Thoman Thoman - 3 months ago 12
PHP Question

regular expression remove comment tag

I want remove html comment tag

<!--QuoteEnd--></div><!--QuoteEEnd--> <!--hide me-->Abc<!--hide me-->


after remove

</div> Abc

Answer
echo preg_replace("/(<!--.+?-->)/s", "", "<!--QuoteEnd--></div><!--QuoteEEnd--> <!--hide me-->Abc<!--hide me-->");

outputs

</div> Abc