Close a zip archive opened by the zip_entry_open() function in PHP

Description

The following code shows how to close a zip archive opened by the zip_entry_open() function.

Example


/*from   w  w w  . ja va  2  s .  c  om*/
<?php
    $zip = zip_open("test.zip");

    if ($zip){
      while ($zip_entry = zip_read($zip)){
         echo "<p>";
         echo "Name: " . zip_entry_name($zip_entry) . "<br />";
         if (zip_entry_open($zip, $zip_entry)){
             // some code
             zip_entry_close($zip_entry);
         }
         echo "</p>";
      }
      zip_close($zip);
   }
?>




















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip