Skip to content

Instantly share code, notes, and snippets.

@trajche
Last active Oct 14, 2021
Embed
What would you like to do?
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?';
}
?>
@HadleighAndHall
Copy link

HadleighAndHall commented Apr 30, 2015

You Sir, Are a true Hero! Love this little script.

@JoshMullins
Copy link

JoshMullins commented May 31, 2015

Thank god for this little fix, true lifesaver.

@unknownArtist
Copy link

unknownArtist commented Oct 5, 2016

thanks man...

@femiowo
Copy link

femiowo commented Jun 21, 2017

Thanks man!

@Wooody82
Copy link

Wooody82 commented Aug 23, 2017

Thank you!

@hungryjos
Copy link

hungryjos commented Aug 29, 2017

Thanks! This saved me a lot of pain!

@agengdp
Copy link

agengdp commented Sep 20, 2017

Thank you, thank you 👍

@kingsolomon17
Copy link

kingsolomon17 commented Mar 7, 2020

thanks man
again please how to i make it it extract to a specific folder

@tenternet
Copy link

tenternet commented Jun 26, 2021

It keeps showing
Something went wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment