How can you preserve "enters" given by the user in the database and show them then to other users?
I store the question of the user and use the following functions to sanitize the user data, prepare it, and execute the SQL command, respectively.
pg_escape_string
pg_prepare
pg_execute
I use htmlentities
with ENT_QUOTES
to convert the data HTML.
This procedure removes all enters, apparently in the form \n, in the question.
I would like to have a similar question-system as in SO: to show only double enters to users as line breaks.