Funkcje ZIP PHP
PHP ZIP Wprowadzenie
Funkcje plików Zip umożliwiają odczytywanie plików ZIP.
Wymagania
Rozszerzenie ZIP wymaga libzip .
Instalacja
Systemy Linux
Aby te funkcje działały, musisz skompilować PHP z opcją --enable-zip.
PHP 5.6: Użyj opcji konfiguracji --with-libzip=DIR , aby użyć systemowej instalacji libzip. Wymagana jest wersja libzip 0.11, z zalecaną wersją 0.11.2 lub nowszą.
PHP 7.3: Odradza się budowanie w oparciu o dołączoną bibliotekę libzip, ale nadal jest to możliwe poprzez dodanie do konfiguracji opcji --without-libzip.
Systemy Windows
Przed PHP 5.3: Użytkownicy muszą włączyć "php_zip.dll" w "php.ini", aby te funkcje działały.
Od PHP 5.3: wbudowane jest rozszerzenie ZIP.
Funkcje ZIP PHP
Function | Description |
---|---|
zip_close() | Closes a ZIP file archive |
zip_entry_close() | Closes a ZIP directory entry |
zip_entry_compressedsize() | Returns the compressed file size of a ZIP directory entry |
zip_entry_compressionmethod() | Returns the compression method of a ZIP directory entry |
zip_entry_filesize() | Returns the actual file size of a ZIP directory entry |
zip_entry_name() | Returns the name of a ZIP directory entry |
zip_entry_open() | Opens a directory entry in a ZIP file for reading |
zip_entry_read() | Reads from an open directory entry in the ZIP file |
zip_open() | Opens a ZIP file archive |
zip_read() | Reads the next file in a open ZIP file archive |