Last active
October 11, 2024 11:25
-
-
Save trajche/11319860 to your computer and use it in GitHub Desktop.
Unzip a file on one.com with PHP
This file contains hidden or 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 | |
$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?'; | |
} | |
?> |
It keeps showing
Something went wrong?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks man
again please how to i make it it extract to a specific folder