| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Accredited PayPal World Seller|
|creating <br /> from textarea|
| 9:01 pm on Oct 26, 2012 (gmt 0)|
If I have a textarea and a complete the form like:
99 Main Street
And I store it in the database.
When I pull it into a variable to be echoed, how do I create the <br />'s i.e. to stop it looking like:
99 Main Street Springfield New York
is it something to do with /n?
| 10:13 pm on Oct 26, 2012 (gmt 0)|
Can't you just echo the <br /> itself? Add it to the end of each string. (Or possibly "<br \/>". I forget.)
:: detour to random page to confirm that that's what I did in recently created navigation footer ::
The difference between \n and and <br> is the same as in ordinary raw html: one affects what you see in the code. The other affects what the user sees.
| 10:18 pm on Oct 26, 2012 (gmt 0)|
You can use the nl2br function:
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved