Re: formatting lf's and the blob

From: Date: Thu, 19 Oct 2000 20:31:57 +0000
Subject: Re: formatting lf's and the blob
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21267@lists.php.net to get a copy of this message
nl2br() formats strings, not necessarily code. The way you normally use nl2br() is to pass it a string: $foo = 'This is a string continued more ...'; Then, run: $new_foo = nl2br($foo); The output is this: This is a string<br> continued<br> more ... -jeremy brand _______________________________________________________________________ GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more __ On Thu, 19 Oct 2000, Floyd Baker wrote: > Date: Thu, 19 Oct 2000 16:25:52 -0400 > From: Floyd Baker <fbaker@olm1.com> > To: jeremy brand <jeremy@nirvani.net> > Cc: php-general@lists.php.net > Subject: Re: [PHP] formatting lf's and the blob > > > We've tried that but perhaps not in the right way...? > > Its in the calling page as so: <? include(nl2br("included.php3")); ?> > This is how I've done it in the past, when calling .txt files... But this is the > first time I've tried to call a php script to pull and print a database text > field. > > Floyd > > > On Thu, 19 Oct 2000 13:00:22 -0700 (PDT), you wrote: > > >remember that line feeds in HTML are <br> tags. There is a function > >called nl2br() that you can shuv in your blob and have HTML formatted > >text to put on your web page. > > > >-jeremy brand > >_______________________________________________________________________ > > GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 > >_ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html > >for more __ > > > >On Thu, 19 Oct 2000, Floyd Baker wrote: > > > >> Date: Thu, 19 Oct 2000 15:55:51 -0400 > >> From: Floyd Baker <fbaker@olm1.com> > >> To: php-general@lists.php.net > >> Subject: [PHP] formatting lf's and the blob > >> > >> > >> Hi.. > >> > >> I see in the archives that the text or blob type should retain the line feeds of > >> the text placed in them. It isn't working that way for me. > >> > >> I have a text box form inputting text to a mysql 'text' field. When I > >> select it > >> and print it to the website, the line feeds are not there... The > >> query/printout scripting is being called to the webpage with an include line. > >> > >> On the other hand; when I pull it back to the text box for editing, simply using > >> 'print $textname' between the textarea tags, everything appears as it > >> should... > >> > >> I've tried nl2br() and other formatting attempts to no avail. > >> > >> Is there a problem using include? Can someone say what might be going wrong? > >> > >> Thanks. > >> > >> Floyd > >> -- > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > >> For additional commands, e-mail: php-general-help@lists.php.net > >> To contact the list administrators, e-mail: php-list-admin@lists.php.net > >> > >> > > > > -- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#21267) next »