PHP preg_replace html comments with empty space

Posted by phpmatt on Stack Overflow See other posts from Stack Overflow or by phpmatt
Published on 2010-03-23T10:28:59Z Indexed on 2010/03/23 10:33 UTC
Read the original article Hit count: 243

Filed under:
|
|
|
|

Hi Guys, I have a bit of php code like this:

$test = "<!--my comment goes here--> Hello World";

Now i want to strip the whole html comment from the string, i know i need to use preg_replace, but now sure on the regex to go in there. Can anybody help? Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about regex