Re: Stripping IMG tags

From: Date: Mon, 12 Nov 2001 07:36:52 +0000
Subject: Re: Stripping IMG tags
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74233@lists.php.net to get a copy of this message
$string = preg_replace('/<img[^>]*>/si', '', $string); "Richard S. Crawford" <rscrawford@mossroot.com> wrote in message news:5.1.0.14.0.20011111153543.00a95e90@pop3.norton.antivirus... All I need to do is strip out IMG tags from strings; I don't want to strip out all of the HTML, just the IMG tags, so the strip_tags() function won't be adequate. I've tried eregi_replace("<img[^$]>","",$string); but that doesn't seem to do any good (though the regexp works fine in Perl). Any thoughts? Sliante, Richard S. Crawford http://www.mossroot.com mailto:rscrawford@mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!"

« previous php.general (#74233) next »