note 24120 deleted from function.nl2br by aidan
| From: | aidan@php.net | Date: | Sun, 10 Oct 2004 10:39:10 +0000 |
| Subject: | note 24120 deleted from function.nl2br by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78282@lists.php.net to get a copy of this message | ||
Note Submitter: mino at abeille dot com
----
The nl2br just put a <br /> tag before the "\n", but does not replace
"\n".
If you use nl2br function before stroring your string in the data base, and you want to show this
text in a textearea for modification for example, don't replace the "<br />"
tag with "\n" but simply delete the "<br /> tag
the following function do that:
function stripbr($str){
$str=eregi_replace('<BR[[:space:]]*/?[[:space:]]*>',"",$str);
return $str;
}