Thanks,
I have finally figured out the syntax for nl2br(), which doesn't seem very
clear in the manual.
I used:
$data = nl2br($data);
That returns just what I expect. However, now I have to get rid of the all
the <BR>s that I have inserted into my data while I was trying to figure
this out.
Thanks for the responses.
-----Original Message-----
From: Matt Williams [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 3:30 PM
To: Shope, Glenn; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Line Breaks
nl2br()
> -----Original Message-----
> From: Shope, Glenn [mailto:[EMAIL PROTECTED]]
> Sent: 23 March 2001 20:49
> To: '[EMAIL PROTECTED]'
> Subject: [PHP-DB] Line Breaks
>
>
> Still haven't figured it out...
>
> I have read several entries about preserving line breaks when displaying
> text from a mySQL database, but I have had no success.
>
> How would I prevent data in a single field containing line breaks
> from being
> displayed in HTML as a single line?
>
> For example:
>
> A person fills out a form with this information:
>
> "My name is Chris.
>
> I like to swim."
>
> Ho do I prevent PHP from writing it as
>
> "My name is ChrisI like to swim." ???
>
>
> I have tried a EREG_REPLACE and PREG_REPLACE attempting to
> replace "\n" with
> <BR>, but it doesn't seem to do the trick.
>
> Any help would be greatly appreciated!!
>
> Glenn :)
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]