// assuming file.zip is in the same directory as the executing script.
$file = ‘filename.zip’;

// get the absolute path to $file
$path = pathinfo(realpath($file), PATHINFO_DIRNAME);

$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
// extract it to the path we determined above
echo “WOOT! $file extracted to $path”;
} else {
echo “Doh! I couldn’t open $file”;

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *