When I built this blog, I decided I didn’t want to have to be putting BR tags in every time I made a post. I didn’t want to be composing an HTML document every time I posted. The most fundamental step I took in that regard is wrapping every post in nl2br, which simply converts newlines to BR tags. I have it set to do it on render, so that my content has less HTML in it in storage, which is good for use in other places.
The catch is that I’ve decided I want to use BRs instead of newlines. I’m thinking of wrapping my input boxes in HTMLarea, a nice WYSIWYG HTML editor.
So my question is, how can I convert every newline in my posts field to BR? Anyone?
Leave a Reply