如何[递归]在PHP中压缩目录?
目录类似于: home/ file1.html file2.html Another_Dir/ file8.html Sub_Dir/ file19.html 我正在使用与PHPMyAdmin http://trac.seagullproject.org/browser/branches/0.6-bugfix/lib/other/Zip.php中使用的相同的PHP Zip类。我不确定如何压缩目录而不是仅压缩文件。这是我到目前为止的内容: $aFiles = $this->da->getDirTree($target); /* $aFiles is something like, path => filetime Array ( [home] => [home/file1.html] => 1251280379 [home/file2.html] => 1251280377 etc... ) */ $zip = & new Zip(); foreach( $aFiles as $fileLocation => $time ){ $file = $target …