title: Delete files after adding them into an archive
body: <p>I have a question, so I need to delete all files from a directory which I added into an archive. I need to create another methode after zip() for delete files? Or I can do simultaneously?
  My code for add in archive:  </p>
  
  <pre><code>define("PATH_TO_FILES_FOR_ARCHIVE","/tmp/");
  define("NOM_OF_ARCHIVE","/tmp/folder.zip");
  
  
  addZip(PATH_TO_FILES_FOR_ARCHIVE, NOM_OF_ARCHIVE);
  
  function addZip($source, $destination)
  {
  if (!extension_loaded('zip') || !file_exists($source)) {
      return false;
  }
  
  $zip = new ZipArchive();
  if (!$zip-&gt;open($destination, ZIPARCHIVE::CREATE)) {
      return false;
  }
  $source = str_replace('\\', '/', realpath($source));
  if (is_dir($source) === true)
  {
      $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
  
      foreach ($files as $file)
      {
          $file = str_replace('\\', '/', $file);
  
          // Ignore "." and ".." folders
          if( in_array(substr($file, strrpos($file, '/')+1), array('.', '..')) )
              continue;
  
          $file = realpath($file);
  
          if (is_dir($file) === true)
          {
              $zip-&gt;addEmptyDir(str_replace($source . '/', '', $file . '/'));
          }
          else if (is_file($file) === true)
          {
              $zip-&gt;addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
          }
      }
  }
  else if (is_file($source) === true)
  {
      $zip-&gt;addFromString(basename($source), file_get_contents($source));
  }
  return $zip-&gt;close();
   }
  </code></pre>
  
  <p>Thx in advance.</p>