note 49119 added to function.strip-tags

From: Date: Mon, 17 Jan 2005 12:22:09 +0000
Subject: note 49119 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-83495@lists.php.net to get a copy of this message
/* 15Jan05 Within <textarea>, Browsers auto render & display certain "HTML Entities" and "HTML Entity Codes" as characters: &lt; shows as < -- &amp; shows as & -- etc. Browsers also auto change any "HTML Entity Codes" entered in a <textarea> into the resultant display characters BEFORE UPLOADING. There's no way to change this, making it difficult to edit html in a <textarea> "HTML Entity Codes" (ie, use of &#60 to represent "<", &#38 to represent "&" &#160 to represent "&nbsp;") can be used instead. Therefore, we need to "HTML-Entitize" the data for display, which changes the raw/displayed characters into their HTML Entity Code equivalents before being shown in a <textarea>. how would I get a textarea to contain "&lt;" as a literal string of characters and not have it display a "<" &amp;lt; is indeed the correct way of doing that. And if you wanted to display that, you'd need to use &amp;amp;lt;'. That's just how HTML entities work. htmlspecialchars() is a subset of htmlentities() the reverse (ie, changing html entity codes into displayed characters, is done w/ html_entity_decode() google on ns_quotehtml and see http://aolserver.com/docs/tcl/ns_quotehtml.html see also http://www.htmlhelp.com/reference/html40/entities/ */ ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49119 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49119&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49119&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49119&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49119&report=yes&reason=useless+example Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49119&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49119&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83495) next »