PHP Zip 함수
PHP Zip 소개
Zip 파일 기능을 사용하면 ZIP 파일을 읽을 수 있습니다.
요구 사항
ZIP 확장자는 libzip 이 필요합니다 .
설치
리눅스 시스템
이러한 기능이 작동하려면 --enable-zip을 사용하여 PHP를 컴파일해야 합니다.
PHP 5.6: --with-libzip=DIR 구성 옵션을 사용하여 시스템 libzip 설치를 사용합니다 . libzip 버전 0.11이 필요하며 0.11.2 이상이 권장됩니다.
PHP 7.3: 번들 libzip에 대한 빌드는 권장되지 않지만 구성에 --without-libzip을 추가하면 여전히 가능합니다.
윈도우 시스템
PHP 5.3 이전: 이러한 기능이 작동하려면 사용자가 "php.ini" 내부에서 "php_zip.dll"을 활성화해야 합니다.
PHP 5.3부터: ZIP 확장이 내장되어 있습니다.
PHP Zip 함수
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 |