Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Max V. Moiseenko  >  gzip  >  example.php  >  Download  
File: example.php
Role: ???
Content type: text/plain
Description: simple example
Class: gzip
Compress and inflate any content with gz format
Author: By
Last change:
Date: 12 years ago
Size: 389 bytes
 

Contents

Class file image Download
<?
if(!defined("_GZIP")) include("gzip.php");


$path = "test.gz";
$filedata = "some file content";

# new object
$gz = new gzip();


# step 1
# add data to archive
$gz->add( $filedata, $path );
# and write gzip file
$gz->write_file($path);



#step 2
# extracting content from archive
if( $g = $gz->extract($path) ){
  # print result structure
  print_r($g);
}
?>