Re: no newline after "?>" in the resulting HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Rostislav Krasny wrote:
Hi,

I've tried to ask the following question on internals@xxxxxxxxxxxxx but
has been pointed out that that mailing list isn't appropriate. So I'm
resinding it here.

I am a newbie to PHP. I've installed a php5-cgi-5.1.2_1 from FreeBSD
ports collection and access it by FastCGI protocol from nginx HTTP
server. I've tried an example of "Hello World" PHP script from the
following tutorial page:

http://www.php.net/manual/en/tutorial.firstpage.php

This is how the resulting HTML code is expected to look like, according
to the tutorial:

<html>
 <head>
 <title>PHP Test</title>
 </head>
 <body>
 <p>Hello World</p>
 </body>
</html>

And following is the HTML code I've got:

<html>
 <head>
 <title>PHP Test</title>
 </head>
 <body>
 <p>Hello World</p></body>
</html>

Why there is no newline afer " <p>Hello World</p>" ?
Is it a PHP bug or the tutorial should be updated?

P.S. I'm not subscribed to this list, please Cc your reply.





I get the same results, I doubt it's a bug, the person who wrote the article maybe never tried what it would output since they probably know how the echo construct works, if you want a line break you should change it to:-


<?php echo "<p>Hello World</p>\n"; ?>

or:-

<?php echo "<p>Hello World</p>" . PHP_EOL; ?>

or:-

<?php echo "<p>Hello World</p>
"; ?>




James

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux