码迷,mamicode.com
首页 > Web开发 > 详细

php ZipArchive文件夹删除

时间:2015-09-17 19:20:24      阅读:523      评论:0      收藏:0      [点我收藏+]

标签:

<?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);
        }
    }
}
?>

  

php ZipArchive文件夹删除

标签:

原文地址:http://www.cnblogs.com/flytome/p/4817276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!