title: how to make zip file downloadable with headers php without saving it on the server
body: <p>I have this code</p>
  
  <pre><code>&lt;?php
  $files = array('includes/s.xlsx', 'includes/test.html');
  $zipname = 'file.zip';
  $zip = new ZipArchive;
  $zip-&gt;open($zipname, ZipArchive::CREATE);
  foreach ($files as $file) {
    $zip-&gt;addFile($file);
   }
  $zip-&gt;close();
  
  
  header('Content-Type: application/zip');
  header('Content-disposition: attachment; filename=filename.zip');
  header('Content-Length: ' . filesize($zipname));
  readfile($zipname);
  </code></pre>
  
  <p>But  i don't want to make the zip file saved to the server i just want it to be served to the users.</p>