Re: Carriage Return and Line Feed
| From: | Mike Flynn | Date: | Wed, 01 May 2002 13:14:38 +0000 |
| Subject: | Re: Carriage Return and Line Feed | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13454@lists.php.net to get a copy of this message | ||
If you look at the output on your page when you output the contents of the mysql text field, you'll notice that the textarea contents is being returned EXACTLY how it was entered. That is to say, the carriage returns and linefeeds are definitely there. However, as in normal HTML, they (\n characters) are considered as white space and not processed as <br> tags, just white space in the code. What you want is a function to convert newline characters to <br> tags.
Luckily, such a function exists!
http://www.php.net/manual/en/function.nl2br.php
-Mike
At 11:20 PM 4/30/2002 -0400, you wrote:
When I use a textarea html tag to put some data into mysql, when I output it the carriage return and laine feed characters from the form do not stick after they are put into mysql text field. Is there a way to out the data with the carriage returns and linefeeds being read? Matt Babineau Freelance Internet Developer e: <mailto:mbabineau@illuminatistudios.com> mbabineau@illuminatistudios.com p: 603.943.4237 w: <http://www.illuminatistudios.com/> http://www.illuminatistudios.comMike Flynn - Burlington, VT http://www.mikeflynn.net/ - mike@mikeflynn.net home=>work=>home=>store=>home [repeat daily]