note 49119 added to function.strip-tags
| From: | dumb at coder dot com | 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:
< shows as < -- & 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 < to represent "<", & to
represent "&"   to represent " ") 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 "<" as a literal string of characters and not
have it display a "<"
&lt; is indeed the correct way of doing that. And if you wanted to display that, you'd
need to use &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