note 52116 added to function.htmlentities
| From: | marques at displague dot com | Date: | Thu, 21 Apr 2005 14:32:25 +0000 |
| Subject: | note 52116 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88351@lists.php.net to get a copy of this message | ||
Re: htmlEncodeText (see below)
<? // added: plus, comma, and tilde - for home dirs and query strings
$pattern = '<([a-zA-Z0-9\.\, "\'_\/\-\+~=;:\(\)?&#%![\]@]+)>'
...
// also, I found the htmlentities call was more useful with UTF-8 output
$textMatches [$key] = htmlentities ($value,ENT_COMPAT,'UTF-8'); ?>
By forcing UTF-8 output, the rest of the page will probably want an UTF-8 character set defined in
the header or by an html meta tag. Optionally, you can set it per element with a charset
(http://www.w3.org/TR/REC-html40/types.html#h-6.9) tag attribute.
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52116
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52116&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52116&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52116&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52116&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52116&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52116&report=yes
Search -- http://master.php.net/manage/user-notes.php