PHP zip_entry_name() — legacy ZIP API

zip_entry_name() reads the name of an entry, including its path inside the ZIP archive. PHP deprecated this procedural function in 8.0. For new code, use ZipArchive::getNameIndex().

A simple example

zip_entry_name()

  1. Start with An entry stored as notes/a.txt
  2. Do this Read its stored name
  3. Result notes/a.txt
The entry name includes the directory prefix recorded in the ZIP.

Use ZipArchive to read entries by name in modern PHP.

To run the examples, save bbminfo.zip and bbminfo-nested-folder.zip beside your script and run it from that directory.