I would recommend not using htmlentities for storing the text in the database, as you are then assuming that data will only ever be used for HTML. Instead use it after retrieving the data and specifically outputting it as [X]HTML. Then when you output it, you can also use the nl2br() function to add <br /> tags wherever there is a newline:
PHP Code:
echo nl2br(htmlentities($value_from_database));
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks