note 27849 rejected from function.htmlspecialchars by nicos
| From: | nicos@php.net | Date: | Sun, 22 Dec 2002 11:50:41 +0000 |
| Subject: | note 27849 rejected from function.htmlspecialchars by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41203@lists.php.net to get a copy of this message | ||
// nohtml //////////////////////////////////////////////////////////////
// formats a string ////////////////////////////////////////////////////
function nohtml($string)
{
$string = stripslashes($string);
$string = str_replace("&", "&", $string);
$string = str_replace("<", "<", $string);
$string = str_replace(">", ">", $string);
$string = str_replace("\"", """, $string);
$string = str_replace("\'", "'", $string);
$string = str_replace("(\r\n|\n|\r)", "<***delete***br>", $string);
return $string;
}
delete the *** and all between them, there's a problem with < br >
(editor: please fix it, I would be happy!)