PDA

Click to See Complete Forum and Search --> : [RESOLVED] Textarea Help


syrillia
Oct 6th, 2009, 09:35 AM
I have a text area that contains this:


12345
12345
12345


When I submit my form, I simply echo the results onto the page, but it prints like this:


12345 12345 12345


How can I get it to print exactly as posted? With the new line? BTW, this is going to be public, so I don't want the users to have to use <br //>.

kows
Oct 6th, 2009, 10:02 AM
you can use a function like nl2br() (http://ca2.php.net/manual/en/function.nl2br.php) to convert new line characters to line breaks in HTML. you could also make a function that formats your text, so that you might be able to add something similar to bbcode to your own website.

syrillia
Oct 6th, 2009, 10:04 AM
Thanks. Now I remember why I use this site! People are so helpful and not impolite in the least. Thanks a lot! Hopefully, I'll do something similar to bbcode at some point, but it's a bit project and I want to get the basics down first. Many thanks!