I have a form which allow user to enter a description or note. It's a textarea called note.
My problem is that when I test enter some note, if I manually press enter to separate paragraph. After I insert into database, extra <br> is added in where I put in the line break so makes my paragraph separate by two line breaks instead of one I manually put in.
Is there a way to do this without adding extra line breaks? Thanks a lot.
Here is the code I used to insert note to database:
$note = addslashes(trim($textarea));
Here is the code I used to display note:
$textarea = stripslashes($note);
(For example:
here is paragraph1, fasfdasdfasdfasdfasdfasdfasdfasdfasdfasdfsdfsdfsadfasdfasdfsdfsd
here is paragraph2, adfasdfasdfsdfsdfasdfsd)
After I retrieve from database using stripslashes($note): it becomes:
here is paragraph1, fasfdasdfasdfasdfasdfasdfasdfasdfasdfasdfsdfsdfsadfasdfasdfsdfsd<br /><br /><br /><br /><br /><br />
here is paragraph2, adfasdfasdfsdfsdfasdfsd)