note 67917 added to function.strip-tags

From: Date: Thu, 06 Jul 2006 11:13:37 +0000
Subject: note 67917 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-114496@lists.php.net to get a copy of this message
I was wondering how can I preserver HTML comments I ended with this simpel trick $html = str_replace('<!--','<TEMP>',$html[0]); $html = str_replace('-->','</TEMP>',$html); $html = strip_tags($html,"<div>,<span>,<style>,<TEMP>"); $html = str_replace('<TEMP>','<!--',$html); $html = str_replace('</TEMP>','-->',$html); ---- Server IP: 216.194.113.175 Probable Submitter: 193.77.41.243 ---- X-Spam-Status: No, hits=4.2 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_40_50,HTML_MESSAGE autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- http://master.php.net/note/edit/67917 Del: integrated -- http://master.php.net/note/delete/67917/integrated Del: useless -- http://master.php.net/note/delete/67917/useless Del: bad code -- http://master.php.net/note/delete/67917/bad+code Del: spam -- http://master.php.net/note/delete/67917/spam Del: non-english -- http://master.php.net/note/delete/67917/non-english Del: in docs -- http://master.php.net/note/delete/67917/in+docs Del: other reasons-- http://master.php.net/note/delete/67917 Reject -- http://master.php.net/note/reject/67917 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#114496) next »