zip_open() function in PHP

王林
Release: 2023-09-07 20:34:02
forward
1372 people have browsed it

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)
Copy after login

Parameters

  • zip_file - The path to the file to open.

  • 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);
       }
    ?>
    Copy after login

    Output

    Compressed: 90
    Compressed: 12
    Compressed: 67
    Copy after login

    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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!