What is zip entry close in PHP
In this article I am going to explain about zip_entry_close function in PHP.
PHP zip_entry_close() Function
The PHP zip_entry_close function is used to closes a zip archive opened by zip_entry_open function.
Syntax of zip_entry_close function
zip_entry_close(zipEntry) |
Parameters in zip_entry_close function
It has only one parameter:
Parameter |
Description |
zipEntry |
It specifies a directory previously opened by zip_entry_open function. |
Example of zip_entry_close function
<?php
$zip = zip_open("email.zip");
if(!$zip)
{
echo "File is not open or unavailable";
}
else
{
while ($zipEntry = zip_read($zip))
{
echo "Name: " . zip_entry_name($zipEntry)."<br/>" ;
if (zip_entry_open($zip, $zipEntry))
{
zip_entry_close($zipEntry);
echo "File has been closed.";
}
}
zip_close($zip);
}
?>
|
Output:
You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here