Cannot line break in PHP using fwrite
<p>I'm using this code to add user input to a text file:</p>

<pre><code>&lt;?php

//establish variables
$myFile = "chapter2.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$name = $_POST["name"];
$gnumber = $_POST["gnumber"];

fwrite($fh, $name); 
fwrite($fh, "\n");
fwrite($fh, $gnumber);

fclose($fh);

?&gt;
</code></pre>

<p>However, it adds it to the text file like this:</p>

<p>namegnumber</p>

<p>Instead of this:</p>

<p>name</p>

<p>gnumber</p>

<p>Why does this happen?</p>
