[PHP] help with nl2br

2006-03-03 Thread canobit canobit
I have cobbled the following code that when it retrieves the data from Mysql, the data is displayed with no line breaks which results in one large paragraph. I have been trying for quite awhile without sucess to get nl2br working with this code. The original data is entered by the user via a te

[PHP] help with nl2br

2005-01-21 Thread Phillip S. Baker
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 Some more copy What I want instead is Some text copy some more text copy Again this is becaus

Re: [PHP] help with nl2br

2006-03-03 Thread Max Schwanekamp
canobit canobit wrote: I have cobbled the following code that when it retrieves the data from Mysql, the data is displayed with no line breaks which results in one large paragraph. I have been trying for quite awhile without sucess to get nl2br working with this code. The original data is ent

Re: [PHP] help with nl2br

2006-03-03 Thread canobit canobit
Thanks Pablo, that did the trick with one minor change, I had to remove the . in the quotations as it is was leading the first line of text with a . echo "" . nl2br($row[2]) . ""; TD. On 3/3/06, Pablo M. Rivas <[EMAIL PROTECTED]> wrote: > > Hello canobit: > > Did you try echo "." . nl2br($row[1

Re: [PHP] help with nl2br

2006-03-03 Thread canobit canobit
> > > All that said, you might want to invest some time in learning a DB > abstraction layer such as ADODb or PEAR::DB (there are lots of others). > You'll commonly find convenience functions to do things like output > query results into an HTML table. Why waste time debugging the wheel? > -- >

RE: [PHP] help with nl2br

2005-01-21 Thread Jay Blanchard
[snip] some text copy Some more copy What I want instead is Some text copy some more text copy [/snip] What you want to do is start with a , then when you run into 2 \n\n you want to replace it with and then end with a http://www.php.net/preg_replace -- PHP General Mailing List (http://www.p

RE: [PHP] help with nl2br

2005-01-21 Thread Samuel DeVore
You might check out http://photomatt.net/scripts/autop "Call this function on the text you want to convert. Think of this code like nl2br on steroids. This is basically a cross-platform set of regular expressions that takes text formatted only by newlines and transforms it into text properly marke

Re: [PHP] help with nl2br

2005-01-21 Thread Karthik
Hey, I would just suggest that you "Explode" the data based on \n and then "walk" through it adding and tags as necessary.. shouldn't be too diffcult. hth -K On Fri, 21 Jan 2005 14:19:38 -0800, Phillip S. Baker <[EMAIL PROTECTED]> wrote: > Greetings all, > > Due to style sheet stuff I n

Re: [PHP] help with nl2br

2005-01-21 Thread Jochem Maas
Phillip S. Baker 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. ... .html: some text copy Some more copy ... .css: .ParaFakeOrWhatEver {

Re: [PHP] help with nl2br

2005-01-24 Thread Richard Lynch
Phillip S. Baker wrote: > 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 > > Some more copy > > What I want instead is > Some text copy > > some more