Rectanglicle

The Personal Website of Ash M. White

Convert Plain-Text Writing Into HTML Paragraphs

by Ash White / 02.05.10

Something that has always irked me is having to take the value of a textarea and convert the text into HTML paragraphs (especially when using a WYSIWYG is not an option). Here's a quick PHP snippet to take care of that, whether the user uses one or two line breaks for new paragraphs.

info

All work is original and copyright 2013 by Ash White, with the exception of a handful of free third-party libraries, including the Scriptaculous JavaScript framework, Lightbox image overlay, Google Font Directory, Google Code Prettify, and Eric Meyer's CSS Reset.