title: fwrite php, file is not really saved?
body: <p>I have a javascript file called in my webpage. It contains only one var :</p>
  
  <pre><code>var tab = [ "img1.jpg" ,
              "img2.jpg" ,
              .......... ,
              "img100.jpg"
            ]
  </code></pre>
  
  <p><code>"img_i_.jpg"</code> in <code>tab</code> are from my data base.</p>
  
  <p>I've written a php code to update this file.</p>
  
  <pre><code>...
  
  $res = mysql_query($sql) or die(mysql_error());
  
  $script="var tab= [\n";
  
  while($r = mysql_fetch_assoc($res) )
      $script .= "\t\"" . $r['name']"\",\n";
  
  $script = $script."];\n";
  
  $fileName = fopen("js/tab.js", "w");
  fwrite($fileName, $script);
  fclose($fileName);
  
  ...
  </code></pre>
  
  <p>When I check out my js file, all is correctly written, but when I reload my page, nothing has changed.</p>
  
  <p>Curiously, when I edit that js file manually, and then save it then my webpage changes after reload.</p>
  
  <p>Why ? And how to solve it ?  Thanks</p>