Re: Re: strip comments from HTML?
| From: | Paul Chvostek | Date: | Fri, 07 May 2004 03:48:36 +0000 |
| Subject: | Re: Re: strip comments from HTML? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185586@lists.php.net to get a copy of this message | ||
On Thu, May 06, 2004 at 07:11:55PM +0000, Curt Zirzow wrote:
> >
> > $text="one <!--bleh\nblarg -> two\n";
> > print ereg_replace("<!--([^-][^-]?[^>]?)*-->", "",$text);
>
> Because your missing a -
> $text="one <!--bleh\nblarg --> two\n";
/me applies mallet to head
% php -r '$text="one <!--bleh\nblarg --> two\n"; print
ereg_replace("<!--([^-][^-]?[^>]?)*-->", "",$text);'
one two
whee, it works! :)
--
Paul Chvostek <paul@it.ca>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/