Well, first of all, this is my folder structure:
images/ image1.png image11.png image111.png image223.png generate_zip.php
And this is min
I went with way2vin's solution. However I had to replace
$zip->addFile("{$file}");
with
$zip->addFromString(basename($file), file_get_contents($file));
which did the trick. Found this here: Creating .zip file