note 97984 rejected from function.nl2br by danbrown

From: Date: Wed, 19 May 2010 13:22:54 +0000
Subject: note 97984 rejected from function.nl2br by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169412@lists.php.net to get a copy of this message
Note Submitter: anupmca at ymail dot com ---- I have seen many developers scratching their head complaining nl2br not working . Simple reason behind this is mysql_real_escape_string which adds extra \ to \n. so it becomes \\n its not a literal its a string. Its better if you use nl2br before mysql_real_escape_string. Dont use striptags function after this which will remove <BR/> as its a html tag. Why cant we modify the base function by supporting it for \\n . It will be better way. Thanks, Anup B.

« previous php.notes (#169412) next »