zip_entry_compressed_size() function in PHP


The zip_entry_compressed_size() function returns the compressed file size of a zip archive entry.

Syntax

zip_entry_compressed_size(zip_entry)

Parameters

  • zip_entry − The zip entry resource. Required.

Return

The zip_entry_compressed_size() function returns the compressed file size of a zip archive entry.

The following is an example that gets the size of the files in "new.zip" archive.

Example

<?php
   $zip = zip_open("new.zip");
   if ($zip) {
      while ($zip_entry = zip_read($zip)) {
         echo "Compressed = ". zip_entry_compressedsize($zip_entry). "<br />";
      }
      zip_close($zip);
   }
?>

Output

Compressed: 90
Compressed: 12
Compressed: 67

Updated on: 26-Jun-2020

42 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements