Skip to content

Instantly share code, notes, and snippets.

@luoxufeiyan
Created September 17, 2021 11:40
Show Gist options
  • Save luoxufeiyan/aa92a3ffc7d50a036941a9d9ec17872b to your computer and use it in GitHub Desktop.
Save luoxufeiyan/aa92a3ffc7d50a036941a9d9ec17872b to your computer and use it in GitHub Desktop.
Unzip compressed packages on shared hosting server without SSH access
<?php
$zip = new ZipArchive();
if ($zip->open('./mail.zip') === true) { // Change this to your zip name
if ($zip->extractTo('./') === true) {
$zip->close();
} else {
exit('Extract Error');
}
} else {
exit('Open Error');
}
echo 'Unzip Complete';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment