I have a problem. I have a text that called from database. In database, the text has an enter text. Here is the picture:
But in my website, it has no enter. Here is the picture.
How to read enter in php?
Here is my code:
$ambil = mysql_query("SELECT * FROM blog WHERE id_blog = '" . $id . "' ");
$deskripsi = $tamp->deskripsi;
<p><?php echo $deskripsi; ?></p>
<p style="white-space: pre">.
You could also replace the newlines in the text with
The latter can be accomplished like this (hat tip to @andrewsi):
<p><?php echo nl2br($deskripsi); ?></p>