PHP zip_entry_compressionmethod() Function

In this chapter you will learn:

  1. Description for PHP zip_entry_compressionmethod() Function
  2. Syntax for PHP zip_entry_compressionmethod() Function
  3. Parameter for PHP zip_entry_compressionmethod() Function
  4. Return for PHP zip_entry_compressionmethod() Function
  5. Example - returns the compression method of a zip archive entry

Description

The zip_entry_compressionmethod() function returns the compression method of a zip archive entry.

Syntax

zip_entry_compressionmethod(zip_entry)

Parameter

ParameterIs RequiredDescription
zip_entryRequired.Zip entry resource to read (a zip entry opened with zip_read() )

Return

The compression method.

Example

Returns the compression method of a zip archive entry


<?php//from  j  av a 2s. c  om
$zip = zip_open("test.zip");

if ($zip){
  while ($zip_entry = zip_read($zip)){
    echo "Name: " . zip_entry_name($zip_entry) . "\n";
    echo "Compression Method: " . zip_entry_compressionmethod($zip_entry);
  }
  zip_close($zip);
}
?>

Next chapter...

What you will learn in the next chapter:

  1. Description for PHP zip_entry_filesize() Function
  2. Syntax for PHP zip_entry_filesize() Function
  3. Parameter for PHP zip_entry_filesize() Function
  4. Return for PHP zip_entry_filesize() Function
  5. Example - returns the original file size before compression of a zip archive entry
Home » PHP Tutorial » PHP Zip Functions
PHP Zip Library Installation
PHP zip_close() Function
PHP zip_entry_close() Function
PHP zip_entry_compressedsize() Function
PHP zip_entry_compressionmethod() Function
PHP zip_entry_filesize() Function
PHP zip_entry_name() Function
PHP zip_entry_open() Function
PHP zip_entry_read() Function
PHP zip_open() Function
PHP zip_read() Function