From bb9cff0e20b3cd9e78493eece493337730bb589c Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Mon, 18 Nov 2002 10:20:52 +0000 Subject: [PATCH] Moved constants to a table, removed the unentities() example and refer to html_entity_decode() instead. A basic rewrite of the docs. See also urlencode() and html_entity_decode(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@104691 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/htmlentities.xml | 79 +++++++++++--------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/reference/strings/functions/htmlentities.xml b/reference/strings/functions/htmlentities.xml index e4cf8d755a..d4e26aecae 100644 --- a/reference/strings/functions/htmlentities.xml +++ b/reference/strings/functions/htmlentities.xml @@ -1,5 +1,5 @@ - + @@ -18,49 +18,60 @@ This function is identical to - htmlspecialchars in all ways, except that - all characters which have HTML character entity equivalents are - translated into these entities. Like - htmlspecialchars, it takes an optional - second argument which indicates what should be done with single - and double quotes. ENT_COMPAT (the default) - will only convert double-quotes and leave single-quotes alone. - ENT_QUOTES will convert both double and - single quotes, and ENT_NOQUOTES will leave - both double and single quotes unconverted. + htmlspecialchars in all ways, except with + htmlentities, all characters which have HTML + character entity equivalents are translated into these entities. - At present, the ISO-8859-1 character set is used as default. - Support for the optional second argument was added in PHP 3.0.17 and PHP - 4.0.3. + Like htmlspecialchars, the optional second + quote_style parameter lets you define what will + be done with 'single' and "double" quotes. It takes on one of three + constants with the default being ENT_COMPAT: + + Available <parameter>quote_style</parameter> constants + + + + Constant Name + Description + + + + + END_COMPAT + Will convert double-quotes and leave single-quotes alone. + + + ENT_QUOTES + Will convert both double and single quotes. + + + END_NOQUOTES + Will leave both double and single quotes unconverted. + + + +
+
+ + Support for the optional quote parameter was + added in PHP 4.0.3. Like htmlspecialchars, it takes an optional third argument which defines character set used in conversion. - Support for this argument was added in PHP 4.1.0. + Support for this argument was added in PHP 4.1.0. Presently, the + ISO-8859-1 character set is used as the default. - There is no reverse of this function. However, you can create one on your - own. Here is an example of how to do this. + If you're wanting to decode instead (the reverse) you can use + html_entity_decode. - - Reverse of <function>htmlentities</function> - - -]]> - - - See also get_html_translation_table, - htmlspecialchars and nl2br. + See also html_entity_decode, + get_html_translation_table, + htmlspecialchars, nl2br, + and urlencode.