Re: help with nl2br

From: Date: Sat, 22 Jan 2005 02:46:51 +0000
Subject: Re: help with nl2br
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207023@lists.php.net to get a copy of this message
Hey, I would just suggest that you "Explode" the data based on \n and then "walk" through it adding <p> </p> and <br /> tags as necessary.. shouldn't be too diffcult. hth -K On Fri, 21 Jan 2005 14:19:38 -0800, Phillip S. Baker <phillipsbaker@gmail.com> wrote: > Greetings all, > > Due to style sheet stuff I need to modify the nl2br (IE create or use a > different function). > > I am pulling data from a database and using nl2br, which does the standard. > > 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> > > Again this is because of css and the designer I am workign with. Is there a > built in function that can do something like this or another function out > there. So far I cannot see anything. Or is there a way to view the coding of > the nl2br function so I can create a new function modifying how it does it. > > Just asking so I do not have to create something from scratch. > Thanks.

« previous php.general (#207023) next »