I am using a php script to unzip ZIP file. but this script unzip only one level of directories without extracting the sub directories of that file
the script:
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->extractTo('/my/destination/dir/');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
for example: if the test.zip contains 2 folders: folder1\file.png, folder2\folder3\file3.png
after extracting this ZIP file, i only see the folder1*.* and folder2*.* but without the sub directory folder3.
How can i improve it?
I think this PHP manual will be helpful to you
http://php.net/manual/en/ref.zip.php