Created
September 17, 2021 11:40
-
-
Save luoxufeiyan/aa92a3ffc7d50a036941a9d9ec17872b to your computer and use it in GitHub Desktop.
Unzip compressed packages on shared hosting server without SSH access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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