recursively remove the contents between each tag

From: Date: Fri, 25 Apr 2003 07:29:40 +0000
Subject: recursively remove the contents between each tag
Groups: php.general 
Request: Send a blank email to php-general+get-145232@lists.php.net to get a copy of this message
how would I properly combine the preg_replace statement with the strip_tags statement so that preg_replace would recursively remove the contents between each tag strip_tags is trying to remove? function safeHTML($text) { $text = stripslashes($text); $text = strip_tags($text, '<table>'); $text = ereg_replace ("<a[^>]+href *= *([^ ]+)[^>]*>", "<a href=\\1>", $text); $text = ereg_replace ("<([b|i|u])[^>]*>", "<\\1>", $text); $text = preg_replace ("/<title[^>]*>/","",$text); return $text; } ?>

« previous php.general (#145232) next »