Page 1 of 1

<textarea> formatting question...

Posted: Wed Feb 21, 2007 5:43 am
by dhrosti
How are line breaks passed from a textarea? Im trying to make sure that what the user enters into the text area is faithfully represented on the html page and so these line breaks need to become "<br / >".

Posted: Wed Feb 21, 2007 5:58 am
by Adrianc333
By, \n

Do something like,

Code: Select all

str_replace("\n", "<br />", $row['message']);
Adrian

Posted: Wed Feb 21, 2007 6:08 am
by dhrosti
thanks.

Posted: Wed Feb 21, 2007 6:45 am
by Jenk
nl2br()