How to use zip entry filesize in PHP

In this article I am going to explain about zip entry filesize function in PHP.
  • 1720

PHP zip_entry_filesize() Function

The PHP zip_entry_filesize function is used to returns the originsl file size of a zip archive entry.

Syntax of zip_entry_filesize function

zip_entry_filesize(zipEntry)

Parameters in zip_entry_filesize function

It has only one parameter:

Parameter Description
zipEntry It specifies a zip entry resource to read.

Example of zip_entry_filesize function

<?php

$Zip=zip_open("email.zip");

if(!$Zip)

{

echo "Unable to open email $Zip file";

}

else

{

while($zipEntry=zip_read($Zip))

{

echo "Name: ". zip_entry_name($zipEntry)."<br/>";

echo "File size is: ". zip_entry_filesize($zipEntry);

}

zip_close($Zip);

}

?>


Output:

zip-entry-filesize-php.jpg

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

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.