Unzip Uncompress a ZIP file in PHP

PHP function to unzip (uncompress) a ZIP file:

function unzipFile($file, $dest)
{
    if(!file_exists($file)) return false;
 
    $zip = new ZipArchive();
 
    if ($zip->open($file) !== true) return false;
 
    $zip->extractTo($dest);
 
    $zip->close();
 
    return true;
}

More Related Posts