You are here: Re: Newlines don't work. « PHP Programming Language « IT news, forums, messages
Re: Newlines don't work.

Posted by Rik on 01/31/07 21:17

Vincent <newsgroup@homeart.cjb.net> wrote:
> lister schreef:
>> Hi,
>> I am trying to output a newline, but this doesn't work:
>> echo "Line1\nLine2";
>> Before anyone says, I know HTML doesn't recognise newlines. I don't
>> need newlines in the rendered HTML, I need newlines in the SOURCE to
>> make it understandable.
>> Cheers,
>> Lister
> echo("line1\n");
> echo("line2");
>
> or
>
> <?php
> $str =3D <<<EOD
> Example of string
> spanning multiple lines
> using heredoc syntax.
> EOD;
> echo($str);
> ?>

While I'm a fan of heredoc, just using single quotes will also work.
-- =

Rik Wasmus

 

Navigation:

[Reply to this 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

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