I’m running into an issue where the new lines in my text are not being displayed after retrieval. Here is how I’m inserting text into the DB:
$text = <<<MESSAGE
line1
line2
line3
MESSAGE;
$sql_text = '"'.mysql_real_escape_string($text).'"';
$sql = "INSERT INTO table (text_value) VALUES ($sql_text)";
Looking at the data in PHPMyAdmin I see the new lines but when I retrieve it like so:
echo str_replace("\r\n", "<br>\n", $text_from_db);
It looks like this:
line1 line2 line3
Any idea what I’m missing?
How do you know new lines are
\r\n? it could be just\n.Use this statement to check,