Reputation: 377
My file structure in zip is
lib
css
js
app1
app2
index.php
All the above files and folders are in test.zip
i want to extract this test.zip using php
$zip = new ZipArchive;
$res = $zip->open("test.zip");
if ($res === TRUE)
{
$zip->extractTo('path');
$zip->close();
}
if lib folder is already exist in the directory where we are unzipping then except lib(folder)
all other files and folders should get override.
how to solve this.
Upvotes: 0
Views: 1348
Reputation: 58
http://php.net/manual/en/ziparchive.open.php , on open, pass in the over write flag.
Upvotes: 0