Created
January 13, 2024 09:18
-
-
Save erdum/16bcda5bc65f456a4691d6aadb3a0a0c to your computer and use it in GitHub Desktop.
Extract zip file with PHP
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 | |
$zipFile = __DIR__ . '/web.zip'; | |
$extractTo = __DIR__ . '/'; | |
$zip = new ZipArchive; | |
if ($zip->open($zipFile) === TRUE) { | |
$zip->extractTo($extractTo); | |
$zip->close(); | |
echo 'Extraction successful!'; | |
} else { | |
echo 'Extraction failed!'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment