note 33370 rejected from function.htmlentities by hholzgra

From: Date: Thu, 02 Aug 2012 11:21:14 +0000
Subject: note 33370 rejected from function.htmlentities by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189581@lists.php.net to get a copy of this message
Note Submitter: Anthony Aragues ---- I found in a previous not the function for encoding the input... which worked great, but it also encoded the &nbsp and <br> that was being automatically added in my POST, so I created and Output function to go with it that worked for me: <?php function VerbatimInput($String) { $Output = mysql_escape_string(htmlentities(addslashes($String))); return $Output; } function VerbatimOutput($Input) { $Output = str_replace("&lt;br /&gt;", "<br>", "$Input"); $Output = str_replace("&amp;nbsp;", "&nbsp", "$Output"); return $Output; } ?>

« previous php.notes (#189581) next »