View Single Post
Old 11-24-2009, 06:19 AM  
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
Regex to strip HTML comments

Trying to strip HTML comments from a web page, someone else must have done this.

I'm using
Code:
$page = preg_replace('/<!--(.|\s)*?-->/', '', $page
which works most of the time but sometimes causes an error. Is there a more reliable one?
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote