note 22488 added to function.nl2br
| From: | webmaster at nemas dot net | Date: | Thu, 20 Jun 2002 01:40:14 +0000 |
| Subject: | note 22488 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32026@lists.php.net to get a copy of this message | ||
I'm glad I found this!! I was strugling to find a way to get textarea strings inserted into a
MySQL database to obey line breaks when displayed for public use....and this did it. I had already
tried AddSlashes and several other things that didn't work.
Quite simple actually....
$text = nl2br($text) ;
echo $text ;
does the trick.
James
--
http://www.php.net/manual/en/function.nl2br.php
http://master.php.net/manage/user-notes.php?action=edit+22488
http://master.php.net/manage/user-notes.php?action=delete+22488
http://master.php.net/manage/user-notes.php?action=reject+22488