How do I correctly format for carriage returns input into textarea boxes?
For example, if a user entered two lines separated by pressing the "enter" key, the text is POSTed without the line feeds.
How do I retain the line feeds?
Retaining carriage returns in textarea boxes
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
If you visit the php.net website function definition for nl2br() and check the comments there is a link to a beefed up version of nl2br().
I believe it is at this web address. It is a pretty good function that I have used in several applications.
I believe it is at this web address. It is a pretty good function that I have used in several applications.