<?php

function unzip_file($file, $destination) {
    // Create object
    $zip = new ZipArchive();
    
    // Open archive
    if ($zip->open($file) !== true) {
        die('Could not open archive');
    }
    
    // Extract contents to destination directory
    $zip->extractTo($destination);
    
    // Close archive
    $zip->close();
    echo 'Archive extracted to directory';
}

?>