I would like to extract the zip folder to a place and replace all the files and folders except a few, how can I do this?
I am currently doing the following.
$backup = realpath('./backup/backup.zip');
$zip = new ZipArchive();
if ($zip->open("$backup", ZIPARCHIVE::OVERWRITE) !== TRUE) {
die ('Could not open archive');
}
$zip->extractTo('minus/');
$zip->close();
How can I set conditions for which files and folders should NOT be replaced? It would be great if you could use some kind of loop.
Thank you all for your help.
source
share