title: file_put_contents, file_append and line breaks
body: <p>I'm writing a PHP script that adds numbers into a text file. I want to have one number on every line, like this:</p>
  
  <pre><code>1
  5
  8
  12
  </code></pre>
  
  <p>If I use <code>file_put_contents($filename, $commentnumber, FILE_APPEND)</code>, the result looks like:</p>
  
  <pre><code>15812
  </code></pre>
  
  <p>If I add a line break like <code>file_put_contents($filename, $commentnumber . "\n", FILE_APPEND)</code>, spaces are added after each number and one empty line at the end (underscore represents spaces):</p>
  
  <pre><code>1_
  5_
  8_
  12_
  _
  _
  </code></pre>
  
  <p>How do I get that function to add the numbers the way I want, without spaces?</p>