RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

how to format the form textarea?

Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 345
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: how to format the form textarea?

  #5  
Jun 17th, 2005
In the example you show, most likely, the user did in fact hit RETURN between those lines. If you are then displaying back in HTML, the two lines will show as one since in HTML, you have to specifically break a line with an HTML element such as <BR />.

What you can do is, just before displaying the string, use PHP's str_replace() function to replace "\n" with "<br />". I think this will give you what you want.
http://us2.php.net/manual/en/function.str-replace.php
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:00 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC