Advertisement
Amadi90

zip-extract.php

Mar 3rd, 2021
799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  1. <?php
  2. $file = 'filename.zip';
  3.  
  4. $unzip = new ZipArchive;
  5.  
  6. $out = $unzip->open($file);
  7.  
  8. if ($out === TRUE) {
  9.   $unzip->extractTo(getcwd());
  10.   $unzip->close();
  11.   echo 'File unzipped';
  12. } else {
  13.   echo 'Error';
  14. }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement