PHP zip_entry_close() Function

In this chapter you will learn:

  1. Description for PHP zip_entry_close() Function
  2. Syntax for PHP zip_entry_close() Function
  3. Parameter for PHP zip_entry_close() Function
  4. Return for PHP zip_entry_close() Function
  5. Example - closes a zip archive opened by the zip_entry_open() 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   j a  va 2  s. c  om*/
$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);
}
?>

Next chapter...

What you will learn in the next chapter:

  1. Description for PHP zip_entry_compressedsize() Function
  2. Syntax for PHP zip_entry_compressedsize() Function
  3. Parameter for PHP zip_entry_compressedsize() Function
  4. Return for PHP zip_entry_compressedsize() Function
  5. Example - returns the compressed file size of a zip archive entry
Home » PHP Tutorial » PHP Zip Functions
PHP Zip Library Installation
PHP zip_close() Function
PHP zip_entry_close() Function
PHP zip_entry_compressedsize() Function
PHP zip_entry_compressionmethod() Function
PHP zip_entry_filesize() Function
PHP zip_entry_name() Function
PHP zip_entry_open() Function
PHP zip_entry_read() Function
PHP zip_open() Function
PHP zip_read() Function