I'm wondering how would i go about keeping the linebreaks in a textarea when its saved to the database so when i call it its the same way.
John Smith Joan Smith
instead of
Perhaps a linebreak character? but i dont want to have to type anything extra in the text area.
I had the same problem, looked round and this did the work for me.
nl2br();
here is an example.
$message=nl2br($_REQUEST['message']);
Message is my forum text field. this keeps line breaks.
umm... ok first of all, textareas supply all your \n s etc. so when you store it in a DB you will keep those. when you echo them out however, as we all know, browers take a newline to mean a space. so you must nl2br() the data so the browser displays it properly.
Great thanks, i knew it has to keep the linebreaks because phpmyadmin had it shown the same way i submited it from my form, just needed that command, thx