note 27849 added to function.htmlspecialchars

From: Date: Fri, 20 Dec 2002 23:04:01 +0000
Subject: note 27849 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-41164@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!) -- http://www.php.net/manual/en/function.htmlspecialchars.php http://master.php.net/manage/user-notes.php?action=edit+27849 http://master.php.net/manage/user-notes.php?action=delete+27849 http://master.php.net/manage/user-notes.php?action=reject+27849

« previous php.notes (#41164) next »