PHP zip_read() — legacy ZIP API

zip_read() advances to the next directory entry in an open ZIP archive. PHP deprecated this procedural function in 8.0. For new code, use ZipArchive::getNameIndex().

A simple example

zip_read()

  1. Start with Archive containing only a.txt
  2. Do this Read its entry directory
  3. Result One entry named a.txt
An archive entry describes a member. Reading its contents is a separate step.

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.