Page 1 of 1

Adding HTML tags to TEXTAREA text?

Posted: Wed Mar 02, 2005 8:30 am
by mjseaden
Hi,

I have a TEXTAREA control, in which I enter text. I then store this text in a MySQL element in a table.

However, when I output the text to the screen through echoing it, the carriage returns don't show. I take it this is because HTML needs <BR> tags for a carriage return, and doesn't recognise the carriage returns in the TEXTAREA.

Is there any function to add appropriate HTML tags automatically in PHP so that when stored in the MySQL element, they will show appropriately?

Many thanks

Mark

Posted: Wed Mar 02, 2005 8:32 am
by n00b Saibot
function nl2br() is for you