RE: [PHP] strip_tags and allowable_tags?

From: Date: Sun, 12 Nov 2000 19:03:56 +0000
Subject: RE: [PHP] strip_tags and allowable_tags?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24870@lists.php.net to get a copy of this message
Funny, the manual link you included on you email shows exactly how to do what you want. I scrolled down about half the page and found the following: scott-at-maxify-dot-com 13-Jan-2000 08:31 In case anybody's wondering what the syntax is for allowable_tags, here you go: <pre> $myString = strip_tags($myString,"<a>,<i>"); </pre> This will strip out all HTML tags from $myString, except A and I tags. I love this feature. :) - Scott > -----Original Message----- > From: Andrew Elliston [mailto:elists@elliston.net] > Sent: Saturday, November 11, 2000 11:17 PM > To: Php ((E-Mail)) > Subject: [PHP] strip_tags and allowable_tags? > > > Does anyone have a simple example of using strip_tags with the > optional allowable_tags? > For instance, what would the syntax be if you wanted to strip the > HTML tags from a string, but leave the <b> tags in? > > I can't seem to find an example anywhere online, and can't guess > the syntax. I thought it would be something similar to: > $string = <b><i>test</i></b>; > echo strip_tags($string, b); > > but this just strips all of the tags off the string, displaying text > > <http://php.net/manual/function.strip-tags.php> > doesn't include a > clear example. > > Thanks, > Andrew Elliston > ------------------------------------------------------------------------- > "Will this bug be fixed, or is it needed for some other functionality?" > -- a new Microsoft Office 2001 user > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#24870) next »