PHP zip_entry_close() Function

Description

The zip_entry_close() function closes a zip archive opened by the zip_entry_open() function.

Syntax

PHP zip_entry_close() Function has the following syntax.

zip_entry_close(zip_entry)

Parameter

ParameterIs RequiredDescription
zip_entryRequired.Zip entry resource to close (a zip entry opened with zip_read() )

Return

Returns TRUE on success or FALSE on failure.

Example

Closes a zip archive opened by the zip_entry_open() function


<?php/*from   www.j  a  va  2s . c o m*/
$zip = zip_open("test.zip");

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




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions