RE: [PHP] help with nl2br
| From: | Jay Blanchard | Date: | Fri, 21 Jan 2005 22:33:26 +0000 |
| Subject: | RE: [PHP] help with nl2br | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207001@lists.php.net to get a copy of this message | ||
[snip]
some text copy<br />
<br />
Some more copy<br />
What I want instead is
<p>Some text copy</p>
<p>some more text copy</p>
[/snip]
What you want to do is start with a <p>, then when you run into 2 \n\n
you want to replace it with </p><p> and then end with a </p>
http://www.php.net/preg_replace