#23723 [Opn->Asn]: Extend strip_tags()

From: Date: Wed, 21 May 2003 06:42:36 +0000
Subject: #23723 [Opn->Asn]: Extend strip_tags()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40115@lists.php.net to get a copy of this message
ID: 23723 Updated by: moriyoshi@php.net Reported By: eric at evilwalrus dot com -Status: Open +Status: Assigned Bug Type: Feature/Change Request PHP Version: 4.3.2RC3 -Assigned To: +Assigned To: moriyoshi Previous Comments: ------------------------------------------------------------------------ [2003-05-20 13:47:14] eric at evilwalrus dot com Right now strip_tags() is a great function. You specify a string and the tags you want to keep. What I would like to see is another argument in strip tags so that you could tell it to keep or remove the tags you specify. I saw bug #5976 that had something to do with this very thought, but this extends the idea further. For example, if I have a string full of HTML and I want to remove all <script> and <meta> tags but keep the rest, I could do something like strip_tags($string, '<meta><script>', true); That boolean value of true as the third argument would tell the strip_tags() function to remove the tags specified. Without that, it defaults to the way it is now and removes all but those tags. I think this would be a very handy thing to have in PHP. Thanks. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23723&edit=1

« previous php.bugs (#40115) next »