PHP Zip



PHP Zip File Introduction

The Zip File function allows you to read compressed files.


Installation

To run the Zip File function on the server, these libraries must be installed:

  • Guido Draheim's ZZIPlib library: Download ZZIPlib library

  • Zip PELC extension: Download Zip PELC extension

Install on Linux system

PHP 5+: The Zip function and Zip library are not enabled by default and must be downloaded from the link above. Please use the --with-zip=DIR configuration option to include Zip support.

Installing on Windows systems

PHP 5+: Zip function will not be enabled by default, you must download php_zip.dll from the link above ZZIPlib library. php_zip.dll must be enabled in php.ini.

To enable any PHP extension, the PHP extension_dir setting (in the php.ini file) should be set to the directory where the PHP extension is located. For example the value of extension_dir might be c:\php\ext.


PHP Zip File Function

PHP: Indicates the earliest PHP version that supports this function.

FunctionDescriptionPHP
zip_close()Close the ZIP file. 4
zip_entry_close()Close an entry in a ZIP file. 4
zip_entry_compressedsize()Returns the compressed size of an item in the ZIP file. 4
zip_entry_compressionmethod()Returns the compression method of an entry in a ZIP file. 4
zip_entry_filesize()Returns the actual file size of an entry in a ZIP file. 4
zip_entry_name()Returns the name of an entry in the ZIP file. 4
zip_entry_open()Open an entry in a ZIP file for reading. 4
zip_entry_read()Read an open entry in a ZIP file. 4
zip_open()Open the ZIP file. 4
zip_read()Read the next item in the ZIP file. 4


PHP Zip File Constants

None.