I have a function that creates zip files when passed an array of files which works beautifully.
$zip_file = create_zip($_FILES['myfile']['tmp_name'],$target);
But what happens is that the files in the zip archive all have the tmp names and no extensions. What would be the best way to alter the array I pass to the function such that the files are named the same way as when they are uploaded?
I’ve rewritten
create_zipto include alocalnamesparameter. Pass in the$_FILES['myfile']['name']for the files’ original names.Usage: