[thelist] Tiny Problem

Joshua Olson joshua at waetech.com
Tue Oct 15 13:20:00 CDT 2002


----- Original Message -----
From: "Jay Blanchard" <jay.blanchard at niicommunications.com>
Sent: Tuesday, October 15, 2002 2:05 PM


> There are new line (\n) characters and there wil be 2 in a row (\n\n) when
> the person hits two 'enters' to break the paragraphs in the text area. Use
> an eregi_replace() to replace this with either two breaks (<br><br>) or
you
> can actually use <p> tags like this in your template;
>
> <p>
> <?php
> //get data from database for $textarea
> do the eregi_replace subbing '</p><p>' every time there are two newlines
> ?>
> </p>

Definitely good advice.  I'd like to add one more suggestion though.  Prior
to replace double newlines with </p><p>, replace newline-whitespace-newline
with newline-newline.  I've had a couple of clients who insist on cutting
and pasting from some applications that put a couple of spaces on the "blank
line" between paragraphs.

-joshua




More information about the thelist mailing list