use of '\n' in Object Oriented PHP book
Posted: Fri May 07, 2010 6:48 am
Hi there,
I have been going through a book called Object Oriented PHP by Peter Lavin.
I've notice a couple of places so far where he is putting together strings of HTML code and he uses '\n' at the end. Such as:
tag.
I don't understand why he does this. There is no '\n' is normal HTML code, so why put one in here? The code works fine without it, but I'd really like to know if I'm missing something important.
Many thanks in advance
Joe
I have been going through a book called Object Oriented PHP by Peter Lavin.
I've notice a couple of places so far where he is putting together strings of HTML code and he uses '\n' at the end. Such as:
I've also seen him use '\n' after aCode: Select all
$this->spanNextInactive = "<span class=\"" . "$this->inactiveSpanName\">$this->navNext</span>\n";
Code: Select all
<br />I don't understand why he does this. There is no '\n' is normal HTML code, so why put one in here? The code works fine without it, but I'd really like to know if I'm missing something important.
Many thanks in advance
Joe