zip_entry_name – Retrieve the Name of a ZIP Archive Entry (PHP)
This article explains the PHP function zip_entry_name, which returns the name of a directory entry within a ZIP archive, details its parameter $zip_entry, describes the return value, and provides a complete example demonstrating how to open a ZIP file, iterate entries, output their names, and close the archive.
The zip_entry_name function in PHP returns the name of a specified directory entry within a ZIP archive.
Parameters: $zip_entry – the directory entry resource returned by zip_read().
Return value:
The name of the directory entry as a string.
Example:
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "Name: " . zip_entry_name($zip_entry) . "<br />";
}
zip_close($zip);
}
?>
// Name: ziptest.txt
// Name: htmlziptest.htmlSigned-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.
