PHP Classes

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Joshua Townsend  >  Zip File  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example of using class to read a zip file
Class: Zip File
Create and extract ZIP archives in purely in PHP
Author: By
Last change: Made file accessible without user login
Date: 8 years ago
Size: 382 bytes


Class file image Download
require "zip.class.php"; // Get the zipfile class
$zipfile = new zipfile; // Create an object
$zipfile->read_zip(""); // Read the zip file

// Now, $zipfile->files is an array containing information about the files
// Here is an example of it's use

foreach($zipfile->files as $filea)
"The contents of {$filea['name']}:\n{$file['data']}\n\n";