You shouldn't nl2br()
, or even htmlentities()
input before storing it in your database. I tend to keep it reasonably raw, which gives more scope to change things later on.
If this is already in production, you could create your own br2nl()
function which reverses the effects of nl2br()
:
function br2nl($input) {
return preg_replace('/<br\\s*?\/??>/i', '', $input);
}