Announcement

Collapse
No announcement yet.

Zip Functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Zip Functions

    I thought ZIP functions were in PHP 4.1.0 and up? I'm using 4.1.1 and the following code won't work:

    http://dynamic3.gamespy.com/~serioussam/ziptest.php

    PHP Code:
    <?php

    $zip 
    zip_open("./test.zip");

    if (
    $zip) {

        while (
    $zip_entry zip_read($zip)) {
            echo 
    "Name:               " zip_entry_name($zip_entry) . "\n";
            echo 
    "Actual Filesize:    " zip_entry_filesize($zip_entry) . "\n";
            echo 
    "Compressed Size:    " zip_entry_compressedsize($zip_entry) . "\n";
            echo 
    "Compression Method: " zip_entry_compressionmethod($zip_entry) . "\n";

            if (
    zip_entry_open($zip$zip_entry"r")) {
                echo 
    "File Contents:\n";
                
    $buf zip_entry_read($zip_entryzip_entry_filesize($zip_entry));
                echo 
    "$buf\n";

                
    zip_entry_close($zip_entry);
            }
            echo 
    "\n";

        }

        
    zip_close($zip);

    }

    ?>
    It says zip_open() is undefined...help!
    Seriously! - The Definitive Home of All Things Serious
    Seriously! Forums

    To recieve support on these forums, enter your username here.

  • #2
    ZIP functions are only enabled if you compiled PHP using --with-zip

    PHP Docs: CVII. Zip File Functions (Read Only Access)

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X