Skip to content
Advertisement

PHP I give breaks when I enter a text to store on data but when I pull it shows horizontal [closed]

I want it to show it as I store on the database

I store like that

It Shows This

Advertisement

Answer

I couldn’t find a good duplicate but I’m sure there is one. There are at least two options:

Display it in pre tags to display the newlines:

echo "<pre>{$row['com_detay']}</pre>";

Or convert the newlines to br for display in HTML:

echo nl2br($row['com_detay']);
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement