Newline character in print statement PHP
<p>Another question for all you pros out here.  I am still trying to learn the language and don't want to pick up any bad habits along the way, and it is easier to fix a problem now rather than later when it is a habit.</p>

<p>This is regarding the correct way to use the \n in a string.</p>

<p>They way the book I am reading does it is as follows:</p>

<pre><code>print "$student: $grade&lt;br /&gt;\n";
</code></pre>

<p>After some reading, I have heard that it is best practice to use single quotes whenever possible, and this is how I have written the same statement:</p>

<pre><code>print $student . ': ' . $grade . '&lt;br /&gt;' . "\n"; 
</code></pre>

<p>What is the preferred method of doing this?  Is the books way or my way more correct?</p>

<p>It seems like the books way is easier to read when reviewing the code, so should I use double or single quotes in a situation like this?</p>

<p>Thank you,
Alex</p>
