Creating a zip file in a specific path without any subfolders
<p>I need to create a Zip file in a specific file path without any sub folders created inside it,
here is my code :</p>

<pre><code>$files = array('article/includes/pdfFiles/file1.txt','article/includes/pdfFiles/file2.txt');
$zipname = 'article/includes/pdfFiles/file.zip';
$zip = new ZipArchive;
$zip-&gt;open($zipname, ZipArchive::CREATE);
foreach ($files as $file) {
    $zip-&gt;addFile($file);
}
$zip-&gt;close();
</code></pre>

<p>I need the file.zip to be created in the path 'assets/uploads/pdfFiles' in this folder, its been created but the problem is inside the zip file these folders exits: assets/uploads/pdfFiles<br>
How can I create the zip file without these folders?</p>