I want to create 5 different files that store data from my database. I want to zip up the 5 files and have this function return the zip.
Can I create the 5 files without actually writing them to disk? The data I get from the db are only strings, so each file will be a long string.
I simply want to do this:
function getZippedFiles()
// Create 1..5 files
// Zip them up
// Return zip
end
main()
// $zip_file = getZippedFiles();
end
Any information on how to do this is much appreciated, thanks!
Sure you can, it’s pretty simple with ZipArchive