PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Mr. Tech
Forum Contributor
Posts: 205 Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia
Post
by Mr. Tech » Wed Feb 19, 2003 1:00 am
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
Tech
Mr. Tech
Forum Contributor
Posts: 205 Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia
Post
by Mr. Tech » Wed Feb 19, 2003 5:53 pm
Thanks!
Mr. Tech
Forum Contributor
Posts: 205 Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia
Post
by Mr. Tech » Wed Feb 19, 2003 6:01 pm
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!
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Fri Feb 21, 2003 3:21 am
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:
Mac
Mr. Tech
Forum Contributor
Posts: 205 Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia
Post
by Mr. Tech » Fri Feb 21, 2003 4:24 am
Thanks.
This is what I used when processing the form:
$textarea = nl2br($textarea);