PHP Classes

Zip File: Create and extract ZIP archives in purely in PHP

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (9)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 47%Total: 9,652 All time: 150 This week: 119Up
Version License PHP version Categories
zipfile 1.0GNU General Publi...4.0Files and Folders, Compression


This class can be used to create and extract ZIP archives.

It can add and list files and directories in a ZIP archive.

The class uses pure PHP code, so it does not use the PHP ZIP extension.

Picture of Joshua Townsend
Name: Joshua Townsend <contact>
Classes: 3 packages by
Country: United States United States
Age: 32
All time rank: 21825 in United States United States
Week rank: 641 Down75 in United States United States Down


How to select files using file date and compress files as zip?
Select files by date and compress files as zip

ZipArchive not found exception, Class not found exception
ZipArchive how to resolve this

Convert the folder to ZIP
convert the folder to ".zip" format in php


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";

  Files folder image Files  
File Role Description
Accessible without login Plain text file example1.php Example Example of using class to zip a file.
Accessible without login Plain text file example2.php Example Example of using class to read a zip file
Plain text file zip.class.php Class The main zipfile class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:150
This week:119Up
User Ratings User Comments (2)
 All time