Re: newline problem
| From: | Jason Wong | Date: | Thu, 25 Jul 2002 04:18:37 +0000 |
| Subject: | Re: newline problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109413@lists.php.net to get a copy of this message | ||
On Thursday 25 July 2002 12:11, Wormy . wrote:
> Dear all,
> this sounds like a silly problem but i really dunno how to fix it!
>
> In the php manual on php.net said we can use an embedded newline just
> by writing the string on different line by pressing "enter" key. This
> doesn't work for me. Another thing is \n also work. For example:
>
> <?php
> echo ' You can also have embedded newlines in strings,
> like this way.';
> echo 'I am trying to include at this point: \n a newline';
> ?>
>
> the output i get is:
> "You can also have embedded newlines in strings, like this way.I am trying
> to include at this point: \n a newline"
>
> Am I doing anything wrong? Thanks!
Stuff like \n are only interpreted if they are enclosed in double-quotes:
"This works\n"
'This does not work\n'
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Iron Law of Distribution:
Them that has, gets.
*/