Tuesday 31 December 2013

unzip folder and files using php code

<!--?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
// using $_SERVER['DOCUMENT_ROOT'] if you don't know the where you are
    $zip->extractTo('/my/destination/dir/');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>

No comments:

Post a Comment