I have some user submitted data that comes from a <textarea>
. I then have some code that inserts a comment above it. Kind of like this....
$my_comment = 'stuff from me';
$user_comment = $_POST['user_comment'];
$full_comment = $my_comment . '\n\n' . $user_comment;
After this, $full_comment
gets inserted into the DB. Later, it gets pulled from the DB and put into a <textarea>
. I want the \n\n
to actually function like new lines, but instead they actually show as "\n\n" in the new <textarea>
.
How can I make the \n\n
function correctly?
BTW, I already know about form validation, PDO, etc. This is just example code.