title: How to add line to the file without delete
body: <p>I want to write a line to the end of the file.</p>
  
  <p>My code is:</p>
  
  <pre><code>$myFile = "serialkey.txt";
  $fh = fopen($myFile, 'w');
  $space = "\r\n";
  
  $stringData = "my new data";
  fwrite($fh, $stringData.$space);
  
  fclose($fh);
  </code></pre>
  
  <p>But when I used this code it deleted all the file and replace "my new data", I want it will not delete my file and append my data to it.</p>