$File = "images/files.txt";
$zip = new ZipArchive();
$filename = "./images/files.zip";
if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFile("$File");
$zip->close();
This code creates a files.zip file inside 'images' folder, if I open that zip file, 'images' folder is there too. I don't want folder 'images' to be there. But only the 'files.txt' file(located inside images folder) needs to be there.
Files structure:
zip.php
images
- files.txt
How can I do that?