PHP zip_entry_name() Function

❮ PHP Zip Reference

Example

Open a ZIP file archive and get the names of the directory entries:

<?php
$zip = zip_open("test.zip");

if ($zip) {
  while ($zip_entry = zip_read($zip)) {
    // Get name of directory entry
    echo "Name: " . zip_entry_name($zip_entry) . "<br>";
  }
  zip_close($zip);
}
?>

The output of the code depends on the contents of the ZIP archive:

Name: ziptest.txt
Name: htmlziptest.html


Definition and Usage

The zip_entry_name() function returns the name of a ZIP directory entry.

Syntax

zip_entry_name(zip_entry)

Parameter Values

Parameter Description
zip_entry Required. Specifies the zip directory entry returned by zip_read()

Technical Details

Return Value: The name of the directory entry
PHP Version: 4.1.0+

❮ PHP Zip Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.