Re: Problems with string replacement

From: Date: Mon, 12 Mar 2001 10:16:53 +0000
Subject: Re: Problems with string replacement
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-43442@lists.php.net to get a copy of this message
On Sunday 11 March 2001 23:44, you wrote: > >> Well, I'm having problems again. This time with string replacement. > >> I'd like people to be able to write notes on one of the site's I'm > >> helping with, and would like them to be able to use Bold, Italic, > >> Underline and <a href> tags. I tried using striptags(); but that > >> would strip anything within double quotes too. So I've gotten > >> around it by > > > > huh? strip_tags works fine for me. > > > > echo strip_tags ('Hello <a > > href="http://foo/">bar</a> > > "world"<br><em>there</em>', '<a> > > <br>'); > > > > creates > > > > 'Hello <a > > href="http://foo/">bar</a> > > "world"<br>there' > > True, but then it doesn't: > -Open the link in a new window ?? You have some tag like <a href="http://foo.bar/" target="_new">link</a> and strip_tags() transforms this to <a href="http://foo.bar/">link</a> ? Or what do you mean with that? > it does: > -remove all content between "and". No. Just plain no. See my example above. The stuff in quotes was kept without any problems. > Of course, I could replace quote marks with htmlspecialchars/entities > or using manual string replacement, but then it'd render all tags using > quote marks invalid. > > See the problem? ;) No ;) Perhaps if you could provide some example code... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032

« previous php.general (#43442) next »