Re: no newline after "?>" in the resulting HTML
| From: | Rostislav Krasny | Date: | Tue, 21 Mar 2006 08:28:48 +0000 |
| Subject: | Re: no newline after "?>" in the resulting HTML | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232298@lists.php.net to get a copy of this message | ||
On Mon, 20 Mar 2006 17:51:32 -0600 (CST)
ceo@l-i-e.com ("Richard Lynch") wrote:
> On Sat, March 18, 2006 12:36 pm, Rostislav Krasny wrote:
> > <p>Hello World</p>
> > </body>
>
> > <p>Hello World</p></body>
>
> > Why there is no newline afer " <p>Hello World</p>" ?
> > Is it a PHP bug or the tutorial should be updated?
>
> The tutorial is imprecise, and glosses over this detail.
>
> For very good reasons, ?>[newline] ignores the trailing [newline]
> character.
>
> If you want the newline, you should do:
>
> <?php
> echo "<p>Hello World</p>\n";
> ?>
Thanks for replying. You're suggesting an obvious but not so handy
workaround of this feature. Jim Lucas, in his reply, pointed me out to
much easier one. He suggested just to add a space after the "?>". I'm
wondering why this trivial thing isn't known to all and wasn't well
documented.