Posted By

zealmurapa on 05/31/12


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

a8ball


Unzip a ZIP FILE FOLDER on a server using PHP - shortest code yet.


 / Published in: PHP
 

Unzip a ZIP FILE FOLDER on a server using PHP - shortest code yet.

  1. <?php
  2. $zip = new ZipArchive;
  3. $res = $zip->open('sc.zip');
  4. if ($res === TRUE) {
  5. $zip->extractTo('sc/');
  6. $zip->close();
  7. echo 'ok';
  8. } else {
  9. echo 'failed';
  10. }
  11. ?>

Report this snippet  

You need to login to post a comment.