Hello,
I am writing a script to take the contents of a textarea and store in a DB.
The data from the textarea
My example is
This is a line
This is a new line
I then send the $_POST variable through a sanitiser function and then through the nbbc.php parser.
The problem is the linebreaks. I know they are there as when you view the field in phpMyAdmin the data is show as
This is a line
This is a new line
however what I actually want to store in the DB is
This is a new line<br>This is a new line
I have tried nl2br but this does not work as this is used to display (echo) the data with line breaks.
I have tried many things found on this forum but none seem to help. Cany anyone help me please to convert the linebreaks directly into <br> so the can store in the DB