PHP nl2br on one line

I usually store data from a textarea directly to the database as is, then once I retrieve it back into HTML I use that lovely PHP function nl2br() to convert it to HTML tags. This works well for most cases until you are passing this data back into javascript where Read more…

By Andrew Odendaal, ago