Get paragraph from text field

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

Post Reply
pschutz93
Forum Newbie
Posts: 1
Joined: Wed Apr 15, 2009 4:30 pm

Get paragraph from text field

Post by pschutz93 »

I want to set up a text field that when submitted is parsed into paragraphs to be written to html code. I can't think of how to do this. Does anyone have any ideas? If more detail is needed, please let me know. Thanks.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Get paragraph from text field

Post by pickle »

Moved to PHP - Code.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Get paragraph from text field

Post by jaoudestudios »

Or if you are happy with <br> or <br /> then you can use nl2br(). This will convert textarea line breaks (user hits enter) to html <br> or <br /> - depending if you are coding xhtml transitional or strict.
Post Reply