title: Add file to sub-folder to ZIP archive?
body: <p>I want to add subfolder with file to archive.</p>
  
  <pre><code>$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
  </code></pre>
  
  <p>I can't use it, because I don't need all files of my folder.
  I have array with some information about files:</p>
  
  <pre><code>$paths = [
  [
      'name' =&gt; 'file',
      'ext'  =&gt; 'txt',
      'path' =&gt; '/folder/'
  ],
  [
      'name' =&gt; 'subFolder',
      'ext'  =&gt; 'folder',
      'path' =&gt; '/folder/'
  ],
  [
      'name' =&gt; 'fileInSubFolder',
      'ext'  =&gt; 'txt',
      'path' =&gt; '/folder/subFolder/'
  ]
  ];
  </code></pre>
  
  <p>In cycle I do it:</p>
  
  <pre><code>if( $folder[$i]['ext'] == 'folder' )
      $zip-&gt;addEmptyDir($fileName);
  else 
      $zip-&gt;addFromString( $fileName.$fileExt, file_get_contents($fileFullPath.$fileExt));
  </code></pre>
  
  <p>If "folder", then I create empty folder in archive, else add file to archive.
  But if file locate in subfolder so file will add to root of archive.
  And, how can I add file to new empty subfolder?
  Or how can I change current directory for add file?</p>