Skip to content

Instantly share code, notes, and snippets.

@kimtrien
Forked from trajche/unzip.php
Created June 24, 2018 02:06
Show Gist options
  • Save kimtrien/534c6130876d12ab6d9d39dcea46a262 to your computer and use it in GitHub Desktop.
Save kimtrien/534c6130876d12ab6d9d39dcea46a262 to your computer and use it in GitHub Desktop.
Unzip a file on one.com with PHP
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment