"\n" in PHP
From: Mudge (mark1822_at_hotmail.com)
Date: 07/11/04
- Next message: Andy Hassall: "Re: "\n" in PHP"
- Previous message: Mudge: "Re: OO in PHP"
- Next in thread: Andy Hassall: "Re: "\n" in PHP"
- Reply: Andy Hassall: "Re: "\n" in PHP"
- Reply: Lc: "Re: "\n" in PHP"
- Reply: Lc: "Re: "\n" in PHP"
- Maybe reply: Lc: "Re: "\n" in PHP"
- Reply: bonehead: "Re: "\n" in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 11 Jul 2004 17:48:44 GMT
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?
For example:
if (mysql_num_rows($result))
{
echo "<div class=\"scroller\">\n";
while ($row = mysql_fetch_array($result))
{
echo "<span class='commentname'>".
htmlspecialchars($row['name']).
"</span><span class='commentdate'>
(". date("1 F j, Y H:i", strtotime($row['comment_date'])).
")</span>\n";
echo "<p class='commenttext'>\n".
nl2br(htmlspecialchars($row['comment'])).
"\n</p>\n";
}
echo "</div>\n";
}
echo "<br />\n";
Why does the book put the "\n"s in there?
- Next message: Andy Hassall: "Re: "\n" in PHP"
- Previous message: Mudge: "Re: OO in PHP"
- Next in thread: Andy Hassall: "Re: "\n" in PHP"
- Reply: Andy Hassall: "Re: "\n" in PHP"
- Reply: Lc: "Re: "\n" in PHP"
- Reply: Lc: "Re: "\n" in PHP"
- Maybe reply: Lc: "Re: "\n" in PHP"
- Reply: bonehead: "Re: "\n" in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|