PHP 폴더를 통채로 압축해서 다운로드 받기
<?php function dirZip($resource,$dir) { if(filetype($dir) === ‘dir’) { clearstatcache(); if($fp = @opendir($dir)) { while(false !== ($ftmp = readdir($fp))){ if(($ftmp !== “.”) && ($ftmp !== “..”) && ($ftmp !== “”)) { if(filetype($dir.’/’.$ftmp) === ‘dir’) { clearstatcache(); // 디렉토리이면 생성하기 $resource->addEmptyDir($dir.’/’.$ftmp); set_time_limit(0); dirZip($resource,$dir.’/’.$ftmp); } else { // 파일이면 파일 압축하기 $resource->addFile($dir.’/’.$ftmp); } } } } if(is_resource($fp)){ closedir($fp); […]