This module uses the functions of the Zziplib Library by Guido Draheim to transparently read ZIP compressed archives and T He files inside them.
This module uses the Zziplib library (Guido Draheim) to read the zip archive and the files inside it
Please note this zziplib only provides a subset of functions provided in a full implementation of the ZIP compression algo Rithm and can only read ZIP file archives. A Normal zip utility is needed to create the zip file archives read by this library.
Note: This library is just a subset of all the extensions in zip, and can only read the contents of the zip document. A normal zip environment requires the ability to create zip documents
ZIP support for PHP is not enabled by default. You'll need to use the--with-zip if the configuration option is compiling PHP to enable zip support. This module requires Zziplib version >= 0.10.6.
PHP does not have default support for ZIP, you need to use--with-zip configuration to compile your PHP. This module requires Zzpilib version >=0.10.6
Note:zip Support before PHP 4.0.7 is experimental. This section reflects the Zip extension as it exists in PHP 4.0.7 and later.
Note: Zip is tested prior to 4.0.7. This chapter is written in php4.0.7 and later versions of Things
Example Usage
This example opens a ZIP file archive, reads each file in the archive and prints out of its contents. The test2.php archive used in this example are one of the test archives in the Zziplib source distribution.
Example 1. Zip Usage Example
$zip = Zip_open ("/tmp/test2.zip");
if ($zip) {
while ($zip _entry = Zip_read ($zip)) {
echo "Name:". Zip_entry_name ($zip _entry). "\ n";
echo "Actual Filesize:". Zip_entry_filesize ($zip _entry). "\ n";
echo "Compressed Size:". Zip_entry_compressedsize ($zip _entry). "\ n";
echo "Compression Method:". Zip_entry_compressionmethod ($zip _entry). "\ n";
if (Zip_entry_open ($zip, $zip _entry, "R")) {
echo "File contents:\n";
$buf = Zip_entry_read ($zip _entry, zip_entry_filesize ($zip _entry));
echo "$BUF \ n";
Zip_entry_close ($zip _entry);
}
echo "\ n";
}
Zip_close ($zip);
}
?>
http://www.bkjia.com/PHPjc/315217.html www.bkjia.com true http://www.bkjia.com/PHPjc/315217.html techarticle This module uses the functions of the Zziplib Library by Guido Draheim to transparently read ZIP compressed archives a nd the files inside them. This module uses the Zziplib library (Guido ...