一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

PHP Zip壓縮 在線對(duì)文件進(jìn)行壓縮的函數(shù)

復(fù)制代碼 代碼如下:
/* creates a compressed zip file */
function create_zip($files = array(),$destination = '',$overwrite = false) {
//if the zip file already exists and overwrite is false, return false
if(file_exists($destination) && !$overwrite) { return false; }
//vars
$valid_files = array();
//if files were passed in...
if(is_array($files)) {
//cycle through each file
foreach($files as $file) {
//make sure the file exists
if(file_exists($file)) {
$valid_files[] = $file;
}
}
}
//if we have good files...
if(count($valid_files)) {
//create the archive
$zip = new ZipArchive();
if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
return false;
}
//add the files
foreach($valid_files as $file) {
$zip->addFile($file,$file);
}
//debug
//echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;

//close the zip -- done!
$zip->close();

//check to make sure the file exists
return file_exists($destination);
}
else
{
return false;
}
}
/***** Example Usage ***/
$files=array('file1.jpg', 'file2.jpg', 'file3.gif');
create_zip($files, 'myzipfile.zip', true);

php Zip 文件在線解壓縮的函數(shù)代碼

php技術(shù)PHP Zip壓縮 在線對(duì)文件進(jìn)行壓縮的函數(shù),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 91精品久久久久亚洲国产 | 色呦呦网站在线观看 | 亚洲一二三区久久五月天婷婷 | 91激情视频 | 91手机视频在线 | 国产成人资源 | 免费国产人做人视频在线观看 | 成人xxx免费视频播放 | 精品欧美日韩一区二区三区 | 精品国产一区二区三区不卡 | 色丫丫 | 久久久久激情免费观看 | 亚洲国产成人久久笫一页 | 国产精品久久久久久久牛牛 | 亚洲天砖砖区免费 | 婷婷春色 | 美女视频黄色的免费 | 天天操天天干天天插 | 免费四虎永久在线精品 | 91福利视频免费观看 | 97青草最新免费精品视频 | 久久久久久久影院 | 中文字幕日韩三级 | 精品一区二区三区在线观看 | 大象焦伊人久久综合网色视 | 在线视频观看一区 | 亚洲美女视频网址 | 国产婷婷色综合成人精品 | 伊人五月综合 | 美女精品视频 | 久久99精品久久久久久秒播 | 五月网站 | 日本高清中文字幕一区二区三区 | 亚洲美女免费视频 | 国产精品美女久久久久网站 | 97国产成人精品免费视频 | 91久久| 日韩美在线 | 91社区在线观看 | 免费国产成人高清视频网站 | 看全色黄大色黄大片色责看的 |