Instantly share code, notes, and snippets.

@trajche /unzip.php
Last active Jul 24, 2018

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

This comment has been minimized.

HadleighAndHall commented Apr 30, 2015

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

@JoshMullins

This comment has been minimized.

JoshMullins commented May 31, 2015

Thank god for this little fix, true lifesaver.

@unknownArtist

This comment has been minimized.

unknownArtist commented Oct 5, 2016

thanks man...

@femiowo

This comment has been minimized.

femiowo commented Jun 21, 2017

Thanks man!

@malasaad82

This comment has been minimized.

malasaad82 commented Aug 23, 2017

Thank you!

@hungryjos

This comment has been minimized.

hungryjos commented Aug 29, 2017

Thanks! This saved me a lot of pain!

@agengdp

This comment has been minimized.

agengdp commented Sep 20, 2017

Thank you, thank you 👍

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