zip_entry_compressedsize() – Retrieve the Compressed Size of a Zip Archive Entry (PHP)
The article explains the PHP function zip_entry_compressedsize(), which returns the compressed size of a specific entry in a ZIP archive, describes its parameter, return value, and provides a complete example demonstrating how to open a ZIP file, iterate over entries, and display each entry’s name and compressed size.
The function int zip_entry_compressedsize(resource $zip_entry) returns the size of a directory entry after compression.
Parameters:
zip_entry – The directory entry resource returned by zip_read().
Return value:
Returns the compressed size of the entry.
Example:
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "<p>";
echo "Name: " . zip_entry_name($zip_entry) . "<br />";
echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "";
echo "</p>";
}
zip_close($zip);
}
?>Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
