open($archive_path, ZipArchive::CREATE); foreach (sdGetFileList(sdGetDocRoot()) as $path) { $entryname = substr($path, strlen(sdGetDocRoot())+1); $zip->addFile($path, $entryname); } $zip->close(); echo "ARCHIVE!\t" . $domain . "\t" . "http://" . $domain . "/" . $archive_name . PHP_EOL;