PHP zip_entry_compressedsize() — legacy ZIP API

zip_entry_compressedsize() reports the compressed size of a ZIP entry in bytes. PHP deprecated this procedural function in 8.0. For new code, use ZipArchive::statIndex().

A simple example

zip_entry_compressedsize()

  1. Start with A two-byte member stored without compression
  2. Do this Read its compressed data size
  3. Result 2 bytes
The stored method keeps the original two data bytes. Archive headers are counted separately.

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.