note 33370 added to function.htmlentities
| From: | Anthony at rack1 dot php dot net | Date: | Tue, 24 Jun 2003 09:24:28 +0000 |
| Subject: | note 33370 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50918@lists.php.net to get a copy of this message | ||
I found in a previous not the function for encoding the input... which worked great, but it also
encoded the   and <br> that was being automatically added in my POST, so I created and
Output function to go with it that worked for me:
function VerbatimInput($String)
{
$Output = mysql_escape_string(htmlentities(addslashes($String)));
return $Output;
}
function VerbatimOutput($Input)
{
$Output = str_replace("<br />", "<br>",
"$Input");
$Output = str_replace("&nbsp;", " ", "$Output");
return $Output;
}
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33370
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33370&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33370&report=yes