title: file_put_contents not overwriting the file?
body: <p>I'm building a game with a maze-type interface with locking and unlocking doors. I have a JSON file that keeps track of the doors that are locked, but I'm having trouble rewriting it when a new door is locked. I'm trying to write a function in PHP to do this, and this is what I have so far:</p>
  
  <pre><code>$jsonString = file_get_contents('info.json');
  $data = json_decode($jsonString,true);
  $data["doors"][0]["right"] = true;
  $newJsonString = json_encode($data);
  var_dump($newJsonString);
  
  file_put_contents('info.json', $newJsonString);
  </code></pre>
  
  <p>The <code>var_dump</code> is producing the right data, but <code>file_put_contents</code> isn't actually changing the file at all. The game doesn't read the new data, and when I manually go and check the file it's still the same as before. I'm using my school's server to host the files so I'm not sure about how it's set up, but I was wondering if anyone had any ideas about what I'm doing wrong?</p>