MENU
Obtaining Information
This obtains the information about the individual files in the zip archive and prints their contents.
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "Name: " . zip_entry_name($zip_entry) . "<br/>";
echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "<br/>";
echo "Compressed Size:" . zip_entry_compressedsize($zip_entry) . "<br/>";
echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "<br/>";
if (zip_entry_open($zip, $zip_entry, "r")) {
echo "File Contents:<br/>";
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
echo "$buf<br/>";
zip_entry_close($zip_entry);
}
echo "<br/>";
}
zip_close($zip);
}
?>
/* (Courtesy of http://my1.php.net/manual/en/zip.examples.php) */