title: How to zip folder without full path
body: <p>firstly I don't which is the correct stackExchange site to post this question if the question is for other stack-site please remove my question.</p>
  
  <p><strong>Now let talk about the question:</strong> This situation is I have a file which is located in: <code>/home/user/public_html/folder-one/folder-two/folder-three/file.php</code> and the file must create archive of folder <code>/folder-one</code> with all files and sub-folders of <code>/folder-one</code>. I create the archive with system function (exec(), shell_exec() or system()) and it works perfect. My code is:</p>
  
  <pre><code>&lt;?php
  $output = 'zip -rq my-zip.zip /home/user/public_html/folder-one -x missthis/\*';
  shell_exec($output);
  ?&gt;
  </code></pre>
  
  <p>But when I download and open the archive the archive include the sub-folders as <code>/home</code> ; <code>/user</code> ; <code>/public_html</code> but this folders are totally unneeded and I wanna know how to create zip without them.</p>
  
  <p>When I try with something like this <code>$output = 'zip -rq my-zip.zip ../../../folder-one -x missthis/\*';</code> but then when I open the archive (on Windows 7 based OS) the name of folder-one is <code>../folder-one</code></p>
  
  <p><strong>Postscript: It will be better if somebody gives me correct</strong> <code>$output</code> <strong>the make zips on windows based hosting plans.</strong></p>
  
  <p>Best regards,
  George!</p>