How to save user-entered line breaks from a TextArea to a database?

TextArea HTML element is preserving the white space in the database.
The problem appears when trying to display the \n on the web browser, which will fail.

To display \n in the web browser use :

<p style="white-space: pre-line">multi-line text</p>

Leave a Comment