Skip to main content
Inspiring
September 19, 2006
질문

Why is my brain deserting me at this critical time?

  • September 19, 2006
  • 13 답변들
  • 436 조회
Folks:

In a PHP page, I have this -

<?php echo('hello'."\n\r"); ?>

yet I do not get the newlines. 'Sup?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



이 주제는 답변이 닫혔습니다.

13 답변

Inspiring
September 19, 2006
Murray *ACE* wrote:
> <?php echo('hello'."\n\r"); ?>
>
> yet I do not get the newlines. 'Sup?

As Dave Buchholz has pointed out, you can put the whole thing in a
double-quoted string. You don't need the silly parentheses, either:

<?php echo "hello\r\n"; ?>

However, even your version works. The reason you don't see the new lines
is because browsers ignore them. I suspect that what you really want is

<?php echo 'hello<br>'; ?>

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Inspiring
September 19, 2006

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:eepdpt$5dm$1@forums.macromedia.com...
> Folks:
>
> In a PHP page, I have this -
>
> <?php echo('hello'."\n\r"); ?>
>
> yet I do not get the newlines. 'Sup?

Windows new lines are \r\n, not the other way around. You'll only see it in
the source code. Is that what you want?


--
--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Cartweaver Development Team
http://www.cartweaver.com

Extending Knowledge Daily
http://www.communitymx.com/


Inspiring
September 19, 2006
<?php echo("hello\n\r"); ?> should do it

--

Dave Buchholz
I-CRE8
www.i-cre8.co.uk
Skype ID: I-CRE8


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:eepdpt$5dm$1@forums.macromedia.com...
Folks:

In a PHP page, I have this -

<?php echo('hello'."\n\r"); ?>

yet I do not get the newlines. 'Sup?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================