Skip to content

Instantly share code, notes, and snippets.



Last active Nov 17, 2018
What would you like to do?
Zip all file from directory
function get_directory_list($dir = '*')
static $files = [];
foreach (glob($dir) as $file) {
if (is_dir($file)) get_directory_list($file . '/*');
else $files[] = $file;
return $files;
$files = get_directory_list('dosyalar/*');
$zip = new ZipArchive();
$zip->open('', ZIPARCHIVE::CREATE);
foreach ($files as $file) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment