title: PHP updating a value in a file
body: <p>I have a PHP script and a file. The file only contains "8". I need to update this value to "9" using the PHP script (or any value, just incrimenting what is in the file by 1).</p>
  
  <p>Currently I have a file that looks like this:</p>
  
  <pre><code>&lt;?php
  file_put_contents("numberFile", file_get_contents("numberFile")[0]++);
  ?&gt;
  </code></pre>
  
  <p>This should write to the file what ever it reads from the first line + 1. However it doesn't work. Is there a better way to do this?</p>