Re: "\n" in PHP
From: Andy Hassall (andy_at_andyh.co.uk)
Date: 07/11/04
- Next message: kingofkolt: "Re: Where are the php extensions?"
- Previous message: Mudge: ""\n" in PHP"
- In reply to: Mudge: ""\n" in PHP"
- Next in thread: Tim Geiges: "Re: "\n" in PHP"
- Reply: Tim Geiges: "Re: "\n" in PHP"
- Reply: Michael Austin: "Re: "\n" in PHP"
- Reply: Jeffrey Silverman: "Re: "\n" in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 11 Jul 2004 19:09:57 +0100
On Sun, 11 Jul 2004 17:48:44 GMT, Mudge <mark1822@hotmail.com> wrote:
>I am reading a book called "PHP, Apache, MySQL Web Development"
>http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764557440.html
>
>and in its example code it sometimes will have a "\n" in it. It is driving
>me crazy because php will ignore the "\n"s so i have no idea why this book
>has them in there. Does anybody know?
What makes you think PHP will ignore the "\n"s? It does not.
>For example:
>
>if (mysql_num_rows($result))
>{
> echo "<div class=\"scroller\">\n";
>
>Why does the book put the "\n"s in there?
To make the produced HTML source easier to read, most likely.
Although if they were concerned about readability they'd consider using single
quotes instead of doubles, and avoiding all those backslashes.
Maybe you're thinking of the fact that newlines aren't significant in HTML,
i.e. it won't force a new line in the rendered output. Nothing to do with PHP,
though.
-- Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
- Next message: kingofkolt: "Re: Where are the php extensions?"
- Previous message: Mudge: ""\n" in PHP"
- In reply to: Mudge: ""\n" in PHP"
- Next in thread: Tim Geiges: "Re: "\n" in PHP"
- Reply: Tim Geiges: "Re: "\n" in PHP"
- Reply: Michael Austin: "Re: "\n" in PHP"
- Reply: Jeffrey Silverman: "Re: "\n" in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|