PHP zip_entry_open() Function
Definition and Usage
The zip_entry_open() function opens a ZIP archive item for reading.
Syntax
zip_entry_open(zip,zip_entry,mode)
Parameters | Description |
---|---|
zip | Required. Specifies the zip resource to be read (the zip file opened by zip_open()). |
zip_entry | Required. Specifies the zip archive resource to be opened (the zip archive item opened by zip_read()). |
mode | Optional. Specifies the access type of the zip archive item. |
Description
In PHP 5, mode is ignored and is always "rb". This is because PHP's zip support is read-only.
Examples
<?php $zip = zip_open("test.zip"); if ($zip) { while ($zip_entry = zip_read($zip)) { echo "<p>"; echo "Name: " . zip_entry_name($zip_entry) . "<br />"; if (zip_entry_open($zip, $zip_entry)) { // some code } echo "</p>"; } zip_close($zip); } ?>