title: PHP Use zLib to Compress Multiple Files
body: <pre><code>$files = array("images/1.jpg", "images/2.jpg", "images/3.jpg"); 
  foreach($files as $file){ 
      $temp = null; 
      $fp_in = fopen($file,'rb'); 
      while(!feof($fp_in)){ 
          $temp .= fread($fp_in,1024); 
      } 
      $output[$file] = $temp; 
      fclose($fp_in); 
  } 
  
  $output = implode('"',$output);
  
  $zp = gzopen( 'sequences/backup.gz', "w9" );
  gzwrite( $zp, $output );
  gzclose( $zp );
  </code></pre>
  
  <p>The code above works but only one file is added to the archive. What is the best way to add multiple files to a archive using zLib?</p>