PHP zip_entry_open() Function
In this chapter you will learn:
- Description for PHP zip_entry_open() Function
- Syntax for PHP zip_entry_open() Function
- Parameter for PHP zip_entry_open() Function
- Return for PHP zip_entry_open() Function
- Example - opens a zip archive entry for reading
Description
The zip_entry_open() function opens a zip archive entry for reading.
Syntax
PHP zip_entry_open() Function has the following syntax.
zip_entry_open(zip,zip_entry,mode)
Parameter
Parameter | Is Required | Description |
---|---|---|
zip | Required. | Zip resource to read (a zip file opened with zip_open() ) |
zip_entry | Required. | Zip entry resource to open (a zip entry opened with zip_read() ) |
Return
This function returns TRUE on success, or FALSE on failure.
Example
Open a zip archive entry for reading
<?php//from java 2s.c om
$zip = zip_open("test.zip");
if ($zip){
while ($zip_entry = zip_read($zip)){
echo "Name: " . zip_entry_name($zip_entry);
if (zip_entry_open($zip, $zip_entry)){
}
}
zip_close($zip);
}
?>
Next chapter...
What you will learn in the next chapter:
- Description for PHP zip_entry_read() Function
- Syntax for PHP zip_entry_read() Function
- Parameter for PHP zip_entry_read() Function
- Return for PHP zip_entry_read() Function
- Example - gets the contents from a open zip archive entry
Home » PHP Tutorial » PHP Zip Functions