简体   繁体   中英

override all files and folders while unziping except given folder name using php

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.

http://php.net/manual/zh-CN/ziparchive.open.php ,在打开时传递覆盖标志。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM