The zip_entry_open() function opens a zip archive for reading.
If successful, the function returns TRUE. If it fails, returns FALSE.
zip_entry_open(zip,zip_entry,mode)
parameter | describe |
---|---|
zip | Required. Specifies the zip resource to be read (zip file opened by zip_open()). |
zip_entry | Required. Specifies the zip project resource to be opened (zip project opened by zip_read()). |
mode | Optional. Specifies the access type for zip archive items. Note: In PHP 5, mode is ignored and is always "rb". This is because zip support in PHP is read-only. |
<?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);}?>