RE: [PHP] Preserving line breaks from form data.
| From: | Shashank Tripathi | Date: | Sat, 29 Jul 2000 12:58:25 +0000 |
| Subject: | RE: [PHP] Preserving line breaks from form data. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8956@lists.php.net to get a copy of this message | ||
Hi Generic
You could escape the newline characters with an HTML BREAK ("<BR>"). For
instance, lets say the name of your HTML form's textbox is "mytext", then
the PHP code to read the text that a user entered in "mytext" would be:
-------------------------------------------------
<?php
echo ereg_replace( "\n", "<br>", $mytext );
?>
-------------------------------------------------
HOpe this helps
Shanx
-----Original Message-----
From: generic@x.duh [mailto:generic@x.duh]On Behalf Of Generic Player
Sent: Saturday, July 29, 2000 8:14 PM
To: php-general@lists.php.net
Subject: [PHP] Preserving line breaks from form data.
What do I need to do to preserve linebreaks people make when putting
data in a form? I have a textarea in a form which stores the input as
$body, but when I print $body, all linebreaks have been turned into
spaces.
Thanks
Generic Player
--
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