RE: [PHP] outputting a carriage return
| From: | (Edward Peloke) | Date: | Thu, 17 Jul 2003 13:24:22 +0000 |
| Subject: | RE: [PHP] outputting a carriage return | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155602@lists.php.net to get a copy of this message | ||
try nl2br()
http://us2.php.net/manual/en/function.nl2br.php
-----Original Message-----
From: bob pilly [mailto:bobpilly@yahoo.co.uk]
Sent: Thursday, July 17, 2003 9:12 AM
To: php-general@lists.php.net
Subject: [PHP] outputting a carriage return
Hi all
Can someone tell me why if i echo a line like this:
echo "this is a \n newline";
the output is:
this is a
newline.
But if i do this: $text="this is a \n newline";
echo $text;
the output is:
this is a newline?
Is there something i have to do to a variable in order for echo or print to
treat special chars like '\n' correctly?
Thanks for any answers in advance!
---------------------------------
Want to chat instantly with your online friends? Get the FREE
Yahoo!Messenger