Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3270
| From | Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Question about new lines |
| Date | 2011-10-02 23:52 +0200 |
| Organization | albasani.net |
| Message-ID | <j6amfk$3b1$1@news.albasani.net> (permalink) |
| References | <4e886e7b$0$5356$9a566e8b@news.aliant.net> |
Linus Flustillbe schrieb:
> -------------------------
> <html>
> <body>
> <?php
> $d=date("D");
> if ($d=="Fri")
> echo "Have a nice weekend!";
> elseif ($d=="Sun")
> echo "Have a nice Sunday!";
> else echo "Have a nice day!";
> echo "\nhello boss"."\t"."does this work".PHP_EOL;
> echo "again";
> ?>
> </body>
> </html>
> ---------------------------------
> When I load this in my browser I see the following
> ------------------------
> Have a nice Sunday! hello boss does this work again
As was to be expected on a Sunday.
> -------------------------
> And if I look at the page source (using Firefox)
> --------------------------
> <html>
> <body>
> Have a nice Sunday!
> hello boss does this work
> again</body>
> </html>
> ------------------------
As was to be expected on a Sunday.
> Should the "\n" not push a NewLine out to the output?
Well it does, doesn't it? Without the "\n" and the PHP_EOL your source
would look like this:
> Have a nice Sunday!hello boss does this workagain
The output of PHP is the HTML source code. How the browser renders that
is another matter. If you want the line breaks to appear in the
browser's output, do as the other posts suggest.
Greetings,
Thomas
--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 14:00 +0000
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 14:17 +0000
Re: Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 16:36 +0000
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 21:58 +0000
Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-03 05:35 +0100
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 07:53 +0000
Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 11:40 +0200
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 07:26 -0400
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 11:42 +0000
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 08:48 -0400
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 13:05 +0000
Re: Question about new lines Robert Heller <heller@deepsoft.com> - 2011-10-03 08:49 -0500
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 14:11 +0000
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:57 -0400
Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 15:14 +0000
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 14:57 -0400
Re: Question about new lines Mason Barge <masonbarge@gmail.com> - 2011-10-05 15:20 -0400
Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:27 +0100
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:54 -0400
Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 14:51 +0200
Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:21 +0100
Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-02 16:21 +0100
Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-02 11:43 -0400
Re: Question about new lines Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-02 19:08 +0000
Re: Question about new lines "Peter H. Coffin" <hellsop@ninehells.com> - 2011-10-02 19:57 -0500
Re: Question about new lines Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2011-10-02 23:52 +0200
Re: Question about new lines Gordon Burditt <gordon@hammy.burditt.org> - 2011-10-03 00:15 -0500
Re: Question about new lines Michael Joel <no@please.com> - 2011-10-04 09:38 -0400
csiph-web