Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the textarea new line problem?! 2

Status
Not open for further replies.

namida

Programmer
May 29, 2003
101
AU
Hi
I browse through the forum and found similar problems, but I can't really understand how to apply it to mine. I'm sure a lot of people have faced this before. Anyway I would greatly appreaciate it if someone would explain to me how to display text with new lines

I have a textarea, and the wrap is at 'physical' it submits to the database, stores it . the database submits it with line. it works fine.

The problem is when I output it. It displays new lines properly when I view source but of course in the browser it all goes into the same line.

There's no \n or whatsoever as far as I know, I tried finding \n from the database and it doesn't exist.

So I don't know how to convert those 'new lines' into <BR>

Should I just use <pre> ?

 
echo nl2br($str);?

Known is handfull, Unknown is worldfull
 
great. nl2br works fine. :)

Thanks everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top