/    Sign up×
Community /Pin to ProfileBookmark

Detect Line Breaks

How can I get php to detect the line breaks in a text area? I’m trying to submit an entry to a MySQL database and then retrieve it again, but when I retrieve it, it’s displayed in one long line. I know that I can just use <br /> in the textarea, but I want this to work for people who don’t know to do that.

Thanks, guys. ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 08.2010 — Use the nl2br() function when outputting the text to the browser.
Copy linkTweet thisAlerts:
@ScottyBoyauthorMay 08.2010 — Thank you very much. That works perfectly. ?
×

Success!

Help @ScottyBoy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...