Re: Large text fields

From: Date: Wed, 01 Nov 2000 19:13:09 +0000
Subject: Re: Large text fields
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23220@lists.php.net to get a copy of this message
You could also do this: $ew_text_fix = eregi_replace("\n\n", "<p>", $ew_text); Replace double line breaks with a <p>. THat's optional and of course, would probably make the formatting look a lot better :) Chris ----- Original Message ----- From: "Claus Nybo" <claus@nnwebdesign.com> To: "Chris Sano" <csano@choiceoneonline.com>; <php-general@lists.php.net> Sent: Wednesday, November 01, 2000 11:16 PM Subject: Re: [PHP] Large text fields > Thanks a lot!! > > This works great. (I really appreciate the fast response) > > Here is what I added: > > $ew_text_fix = eregi_replace("\n", "<br>", $ew_text); > > Just curious, is there any thing else like this that can be done to transfer > the format of text entered? > > Regards, > > Claus > > > > From: Chris Sano <csano@choiceoneonline.com> > > Organization: Choice One OnLine > > Reply-To: Chris Sano <csano@choiceoneonline.com> > > Date: Wed, 01 Nov 2000 12:14:43 -0500 > > To: Claus Nybo <claus@nnwebdesign.com>, php-general@lists.php.net > > Subject: Re: [PHP] Large text fields > > > > Use eregi_replace() to replace the line breaks with <p> and <br> tags. > > > > Chris > > > > ----- Original Message ----- > > From: "Claus Nybo" <claus@nnwebdesign.com> > > To: <php-general@lists.php.net> > > Sent: Wednesday, November 01, 2000 9:21 PM > > Subject: [PHP] Large text fields > > > > > >> Hi, > >> > >> I am working on a website using php3 and mySQL. On one page in the site > >> administration is inputting new articles, via a form, with fields such as > >> $title, $date, $article, etc. These are then passed to mySQL, to be viewed > >> on another page by users. > >> > >> This all works fine, except for the text of the article itself. When the > >> text is typed in to the textfield on the form, it exist of several > >> paragraphs, with blank lines in between, but when it is viewed from the > >> database on another page all the paragraph breaks and blank lines are > > gone, > >> and all the text is displayed in just one long continued block. > >> > >> What do I do to preserve the format in which the text is typed? With the > >> different paragraf breaks and blank lines? > >> > >> Thanks for the help! > >> > >> Claus > >> > >> > >> -- > >> 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 (#23220) next »