Re: stripping tags with regex ?

From: Date: Tue, 03 Apr 2001 20:34:50 +0000
Subject: Re: stripping tags with regex ?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-46886@lists.php.net to get a copy of this message
On Tuesday 03 April 2001 19:57, you wrote: > I was interested in stripping the content between the tags too though. > the content between the tags is allways 18 char so I did this. > > $article_body = ereg_replace("<image+>.{18}</image> ", '', > $article_body); > > that seemed to work. oi, regex is bad stuff, haha. $body = preg_replace ('/<image[^>]*>.*?</image>/i', '', $body); is a bit more robust. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) CPU not found. retry, abort, ignore?

« previous php.general (#46886) next »