Page 1 of 1

Article

Posted: Wed Feb 19, 2003 1:00 am
by Mr. Tech
Hi!

I am making an article manager and need some help. For example this forum. I type my post in the textarea and it automatically puts a

<br />

for every break. How can I do that?

Thanks :wink:

Tech

Posted: Wed Feb 19, 2003 2:55 am
by lazy_yogi

Posted: Wed Feb 19, 2003 5:53 pm
by Mr. Tech
Thanks!

Posted: Wed Feb 19, 2003 6:01 pm
by Mr. Tech
I had a look and I have no idea on what I need to do. Does any one think they could write up a littel something that will do it for me? Thanks!

See in some of the users comments they replace these \n. I tried that and it didn't work.

Thanks for any help! :D

Posted: Fri Feb 21, 2003 3:21 am
by twigletmac
All you need to do is run this function on the info from the text area before you want to display it and it will put a HTML line break next to all the new line characters. Just do something like:

Code: Select all

echo nl2br($my_textarea);
Mac

Posted: Fri Feb 21, 2003 4:24 am
by Mr. Tech
Thanks.

This is what I used when processing the form:

$textarea = nl2br($textarea);

:D