Extract zip file content with php


SUBMITTED BY: amsaid

DATE: Aug. 8, 2016, 3:23 p.m.

FORMAT: PHP

SIZE: 280 Bytes

HITS: 670

  1. <?php
  2. $zip = new ZipArchive();
  3. $filename = "file_path.zip";
  4. if ($zip->open($filename)!==TRUE) {
  5. exit("cannot open <$filename>\n");
  6. }
  7. $zip->extractTo('target_folder');
  8. echo "numfiles: " . $zip->numFiles . "\n";
  9. echo "status:" . $zip->status . "\n";
  10. $zip->close();

comments powered by Disqus