I have a zip file which have one folder named Objects. Inside Objects folder I have one Xml file. I need to get data from that xml file using PHP.
I tried following code
$file = 'file.zip';
$path = pathinfo(realpath($file), PATHINFO_DIRNAME);
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
$zip->extractTo($path);
$zip->close();
echo "WOOT! $file extracted to $path";
} else {
echo "Doh! I couldn't open $file";
}
But it returns an empty folder named Objects. The xml inside the folder is missing.
Can anybody tell me What I am missing?