Reply to Re: Can't get \n to work.

Your name:

Reply:


Posted by sk on 10/06/06 15:03

tried following with same results.... no new line

$foo = 2;
echo "foo is $foo"; // this prints: foo is 2
echo 'foo is $foo'; // this prints: foo is $foo
echo "foo is $foo\n\r"; // this prints: foo is 2 (with a new-line)
echo 'foo is $foo\n'; // this prints: foo is $foo\n

Norman Peelman wrote:

> <petersprc@gmail.com> wrote in message
> news:1160010036.756728.4270@h48g2000cwc.googlegroups.com...
>
>>Can you paste the code that isn't working? The zend.com tutorial is
>>exactly right.
>>
>>sk wrote:
>>
>>>According to zend.com
>>>
>>>Double and single quoted strings are handled differently by PHP. Double
>>>quoted strings are interpreted while single quoted strings are treated
>>>exactly as written. For example:
>>>
>>>$foo = 2;
>>>echo "foo is $foo"; // this prints: foo is 2
>>>echo 'foo is $foo'; // this prints: foo is $foo
>>>echo "foo is $foo\n"; // this prints: foo is 2 (with a new-line)
>>>echo 'foo is $foo\n'; // this prints: foo is $foo\n
>>>
>>>I can not get this to work.
>>
>
> Sometimes you must add \r to it like so:
>
> echo "foo is $foo\n\r";
>
> Norm
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация