File: /home/imensosw/public_html/imenso.co/matrix/unzip.php
<?php
// assuming file.zip is in the same directory as the executing script.
$file = '360893.zip';
// get the absolute path to $file
echo $path = pathinfo(realpath($file), PATHINFO_DIRNAME).'/360893';
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
// extract it to the path we determined above
$zip->extractTo($path);
$zip->close();
echo "WOOT! $file extracted to $path";
} else {
echo "Doh! I couldn't open $file";
}
?>