PHP Zip File Functions

EditRocket provides the following information on Zip File functions in the PHP source code builder.

void zip_close ( resource $zip ) - Closes the given ZIP file archive.

bool zip_entry_close ( resource $zip_entry ) - Closes the specified directory entry.

int zip_entry_compressedsize ( resource $zip_entry ) - Returns the compressed size of the specified directory entry.

string zip_entry_compressionmethod ( resource $zip_entry ) - Returns the compression method of the directory entry specified by zip_entry.

int zip_entry_filesize ( resource $zip_entry ) - Returns the actual size of the specified directory entry.

string zip_entry_name ( resource $zip_entry ) - Returns the name of the specified directory entry.

bool zip_entry_open ( resource $zip , resource $zip_entry [, string $mode ] ) - Opens a directory entry in a zip file for reading.

string zip_entry_read ( resource $zip_entry [, int $length ] ) - Reads from an open directory entry.

mixed zip_open ( string $filename ) - Opens a new zip archive for reading.

mixed zip_read ( resource $zip ) - Reads the next entry in a zip file archive.

bool ZipArchive::addEmptyDir ( string $dirname ) - Adds an empty directory in the archive.

bool ZipArchive::addFile ( string $filename [, string $localname ] ) - Adds a file to a ZIP archive from a given path

bool ZipArchive::addFromString ( string $localname , string $contents ) - Add a file to a ZIP archive using its contents.

bool ZipArchive::close ( void ) - Close opened or created archive and save changes. This method is automatically called at the end of the script.

bool ZipArchive::deleteIndex ( int $index ) - Delete an entry in the archive using its index.

bool ZipArchive::deleteName ( string $name ) - Delete an entry in the archive using its name.

mixed ZipArchive::extractTo ( string $destination [, mixed $entries ] ) - Extract the complete archive or the given files to the specified destination.

string ZipArchive::getArchiveComment ( void ) - Returns the Zip archive comment.

string ZipArchive::getCommentIndex ( int $index [, int $flags ] ) - Returns the comment of an entry using the entry index.

string ZipArchive::getCommentName ( string $name [, int $flags ] ) - Returns the comment of an entry using the entry name.

mixed ZipArchive::getFromIndex ( int $index [, int $flags ] ) - Returns the entry contents using its index.

mixed ZipArchive::getFromName ( string $name [, int $flags ] ) - Returns the entry contents using its name.

string ZipArchive::getNameIndex ( int $index ) - Returns the name of an entry using its index.

resource ZipArchive::getStream ( string $name ) - Get a file handler to the entry defined by its name. For now it only supports read operations.

mixed ZipArchive::locateName ( string $name [, int $flags ] ) - Locates an entry using its name.

mixed ZipArchive::open ( string $filename [, int $flags ] ) - Opens a new zip archive for reading, writing or modifying.

bool ZipArchive::renameIndex ( int $index , string $newname ) - Renames an entry defined by its index.

bool ZipArchive::renameName ( string $name , string $newname ) - Renames an entry defined by its index.

mixed ZipArchive::setCommentName ( string $name , string $comment ) - Set the comment of an entry defined by its name.

mixed ZipArchive::setArchiveComment ( string $comment ) - Set the comment of a ZIP archive.

mixed ZipArchive::setCommentIndex ( int $index , string $comment ) - Set the comment of an entry defined by its index.

mixed ZipArchive::statIndex ( int $index [, int $flags ] ) - The function obtains information about the entry defined by its index.

mixed ZipArchive::statName ( name $name [, int $flags ] ) - The function obtains information about the entry defined by its name.

mixed ZipArchive::unchangeAll ( void ) - Undo all changes done in the archive.

mixed ZipArchive::unchangeArchive ( void ) - Revert all global changes to the archive archive. For now, this only reverts archive comment changes.

mixed ZipArchive::unchangeIndex ( int $index ) - Revert all changes done to an entry at the given index.

mixed ZipArchive::unchangeName ( string $name ) - Revert all changes done to an entry.