$zip->addDirectory($name); #creates empty directory $zip->addFile($name); #adds file to zip's root folder # I have no clue how to add a file to the newly created directory $zip->addTree($dir,$zipFoldername); #works, but will include all of dir's subfolders if any exist