Jacek's Create Zip files tutorial
Posted: Mon Nov 12, 2012 9:55 am
I'm so noob in this that I didn't even know it was possible to create zip files in a PHP file lol
but I have a question.
This is one part of the code, the one that interests me, for now
But if I have more than one folder?
How am I going to choose?
Another question
How can I change the name? instead of example, I want another nice, like, the name of the folder, the thing here is to get the file name.
Or change it to a random name
for that I think I have to define the charset, and use rand() function, but not sure where to use it
but I have a question.
This is one part of the code, the one that interests me, for now
$zip = new ZipArchive(); $zip->open('example.zip', ZipArchive::CREATE); $files = scandir('uploads'); unset($files[0], $files[1]); print_r($files)Jacek has only one folder with 4 images inside
But if I have more than one folder?
How am I going to choose?
Another question
How can I change the name? instead of example, I want another nice, like, the name of the folder, the thing here is to get the file name.
Or change it to a random name
for that I think I have to define the charset, and use rand() function, but not sure where to use it