Home  >  Article  >  Backend Development  >  zip_open() function in PHP

zip_open() function in PHP

王林
王林forward
2023-09-07 20:33:031431browse

zip_open() function in PHP

zip_open() function opens a zip file for reading. Returns an open zip file on success, FALSE on failure.

Syntax

zip_open(zip_file)

Parameters

  • zip_file - The path to the file to open.

  • ul>

    Returns

    zip_open() function returns an open zip file on success and FALSE on failure.

    Example

    <?php
       $zip = zip_open("new.zip");
       if ($zip) {
          while ($zip_entry = zip_read($zip)){
             echo "Compressed = ". zip_entry_compressedsize($zip_entry). "<br/>";
          }
          zip_close($zip);
       }
    ?>

    Output

    Compressed: 90
    Compressed: 12
    Compressed: 67

The above is the detailed content of zip_open() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete