New Lines to Paragraphs PHP

Don’t you hate it when you read a blog or web page where there aren’t proper paragraphs, just one huge one (or none at all) with a million <br /> tags, no semantic meaning at all. Also no opportunity to implement typographic styling using CSS concerning indents or paragraph spacing, much like is done on this site (but you won’t see it without Mozilla or a similarly standards compliant browser).

Well it’s not really the fault of the person, often it’s a symptom of the publishing system. Most don’t go beyond simply converting line breaks into a break tag. Just like curly quotes, the system should take care of it. So I wrote a little function which allows you to format your text into paragraphs using only the enter key. I’ve already put this on a couple for my client’s sites where I was using straight nl2br and I’m very happy with the result. Check it out and let me know what you think.

SHARE YOUR THOUGHTS