* Thus wrote Matt Palermo ([EMAIL PROTECTED]): > I have a page where I am stripping the html tags down. Basically, it will > allow certain tags, but still strips out ALL attributs of the tag, so it > works something like this: > > $allowed_tags = "<p><br><strong><b><i><u>"; > // State which tags are allowed > $info = strip_tags($info, $allowed_tags); > // Strip all unwanted tags out > $allowed_tags = "p|br|strong|b|i|u"; > // Convert tags for regular expression > $info = preg_replace("/<(?!".$allowed_tags.")[^>]*>/", '<\1>', $info); // > Strip out all attributes from allowed tags
You might wont to try a look behind assertion: /< (?<=p|br) [^>]+ >/x Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php