Share on Google+Share on Google+

Read a zip file.

zip_entry_read() example


In this example the function zip_entry_read() will help in reading a zip file. First select a file to be opened. Name that file into zip file and direct the zipread command to read it through while loop. The zip_entry_read command will read one byte at a time. when it reads all the contents, it will executed and file will be closed. 

$zipname = zip_open("");
if ($zipname){ 
while($zipcontent = zip_read($zipname)){
echo zip_entry_name($zipcontent);
if (zip_entry_open($zipname, $zipcontent)){ 
$content = zip_entry_read($zipcontent,1024);
echo "Contents : ".$content;


Posted on: July 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null