title: Save a gzipped html file on server by using PHP gzipp
body: <p>I use this script to automatically save a PHP-file into a HTML file on my server:</p>
  
  <pre><code>&lt;?php
  $page=file_get_contents('http://yourdomain.com/index.php');
  $fp=fopen('index.html','w+');
  fputs($fp,$page);
  fclose($fp);
  ?&gt;
  </code></pre>
  
  <p>How can I get the server to also save a Gzipped version of index.php on the server?</p>
  
  <p>The goal is to have the following files in the folder:</p>
  
  <ul>
  <li><p>turn-indexphp-into-indexhtml-and-indexgz.php</p></li>
  <li><p>index.php</p></li>
  <li><p>index.html</p></li>
  <li><p>index.gz</p></li>
  </ul>