php ZipArchive文件夹删除

<?php
$z = new ZipArchive;
$folder_to_delete = "gifresizer/resized/";  //folder to delete relative to root
if($z->open("gifresizer.zip")===TRUE){      //zip file name
    print_r($z);
    for($i=0;$i<$z->numFiles;$i++){
        $entry_info = $z->statIndex($i);
        print_r($entry_info);
        if(substr($entry_info["name"],0,strlen($folder_to_delete))==$folder_to_delete){
            $z->deleteIndex($i);
        }
    }
}
?>

  

posted on 2015-09-17 18:11  darkness_1  阅读(418)  评论(0编辑  收藏  举报

导航