File: example.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq  >  PHP ZIP Handler Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP ZIP Handler Class
Create and extract ZIP files with compressed data
Author: By
Last change: Apply fixes from StyleCI
Date: 2 years ago
Size: 899 bytes
 

Contents

Class file image Download
<?php


require_once 'classes/Zip.php';

$zip = new Zip();

/**
 * //Note if you want manipulate files in outside the root of server / script you may use my file manipulation class here is two possible link
 * Github: https://github.com/Lablnet/PHP-files-manipulation-class
 * Alternative: https://www.phpclasses.org/package/10621-PHP-Manipulate-files-and-directories-in-several-ways.html
 * please fork/rate these classes if you like thanks.
 */
//compress file
$comp = $zip->Compress(
[
'data/image/one.png', 'data/image/two.png'],
'data/compressed/images.zip', false
);
if (
$comp === true) {
    echo
'file successfully compressed ';
} else {
    echo
'already / something went wrong ';
}

//extract file
$ext = $zip->Extract(
   
'data/compressed/images.zip', 'data/extract/'
);
if (
$ext === true) {
    echo
' file extract successfully ';
} else {
    echo
' already / something went wrong ';
}


For more information send a message to info at phpclasses dot org.