title: Unable to extract zip file which generated using php
body: <p>I have written the PHP script to generate the zip file. it's working fine when I use rar software to extract it but not getting extract with rar software. I can't ask to users to install rar software to extract downloaded zip file.</p>
  
  <p>I don't know where i am commiting mistakes.
  Here i attached error screen shot which i get when try to open zip file.
  <a href="https://i.stack.imgur.com/d3t45.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d3t45.png" alt="Opening zip file without using any software"></a></p>
  
  <pre><code>// Here is code snippet
  $obj-&gt;create_zip($files_to_zip, $dir . '/download.zip');
  
  // Code for create_zip function
  //create the archive
  $zip = new ZipArchive();
  if ($zip-&gt;open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
      return false;
  }
  //add the files
  foreach ($valid_files as $file) {    
      $filearr = explode('/', $file);
      $zip-&gt;addFile($file, end($filearr));
  }
  $zip-&gt;close();
  </code></pre>