CODE CODIFY.CLUB

Extract zip file using PHP script

Following is PHP code to extract zip file on current position. 

<?php

$file = ‘zip_filename.zip’;
$path = ‘./zip/’;

$zip = new ZipArchive;
if ($zip->open($file) === TRUE) {
    $zip->extractTo($path);
    $zip->close();
    echo ‘ok’;
} else {
    echo ‘failed’;
}

?>

V!ral

Developer, Technology aficionado, Beer Lover and founder of codify.club Network. Who shares a keen interest about website development, health issues, cancer awareness and other fun stuff.

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular

Most discussed