note 27849 rejected from function.htmlspecialchars by nicos

From: 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("&", "&amp;", $string); $string = str_replace("<", "&lt;", $string); $string = str_replace(">", "&gt;", $string); $string = str_replace("\"", "&quot;", $string); $string = str_replace("\'", "&#039;", $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!)

« previous php.notes (#41203) next »