RE: [PHP] Data entered by a form
| From: | Christensen, BruceX R | Date: | Fri, 11 Aug 2000 22:01:38 +0000 |
| Subject: | RE: [PHP] Data entered by a form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11421@lists.php.net to get a copy of this message | ||
$text = str_replace("\n", "<br>", $text);
$text = str_replace("<br><br>", "<p>", $text);
That should do it for most situations (single and double newlines). If
there are three or four, it may break.
--Bruce
Bruce Christensen
Intel Corporation
brucex.r.christensen@intel.com
-----Original Message-----
From: Phillip S. Baker [mailto:phillip@wordsandimages.com]
Sent: Friday, August 11, 2000 2:54 PM
To: php-general@lists.php.net
Subject: [PHP] Data entered by a form
Greetings All,
Okay I have a form.
There is a textarea field that holds a large amount of copy.
The results get plugged into MySQL.
Is there a way when the copy is pulled out of the DB by PHP to format
the data so that \n and \r values are converted to <BR> and <P> html
tags so the copy is formatted correctly?
Thanks
--
Phillip S. Baker
phillip@wordsandimages.com
Words & Images, Inc.
1535 Seabright Avenue, Suite 100, Santa Cruz, CA 95062
Direct Line (831) 420-2641 / Fax (831) 458-0808