note 16787 added to function.strip-tags

From: Date: Tue, 13 Nov 2001 15:23:41 +0000
Subject: note 16787 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-20801@lists.php.net to get a copy of this message
The strip_tags() function has trouble with pages that include JavaScript. I've gotten around this by HTML-commenting out the JavaScript correctly ("<!--" at the beginning, and "// -->" at the end of the script), and preceding calls to strip_tags() with: $text=preg_replace('/<!--.+?-->/','',$text); This assumes that the HTML has been imploded to get rid of line-breaks. -- http://www.php.net/manual/en/function.strip-tags.php http://master.php.net/manage/user-notes.php?action=edit+16787 http://master.php.net/manage/user-notes.php?action=delete+16787 http://master.php.net/manage/user-notes.php?action=reject+16787

« previous php.notes (#20801) next »