Compressing Data with GZIP - PHP / MySQL Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
Compressing Data with GZIP
Category : PHP / MySQL | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

QUICK TUTORIAL

If you wish o compress a string of any length, you can use GZIP compression functions such as
[*]gzcompress()
[*]gzuncompress()

there are some more functions on compression but we will eb using these two only.


HOW TO COMPRESS ?


//uncompressed (simple string before compression)
$str = "My Name is Ali Imran Khan Shirani - This is my uncompressed string";

//compressed version
$compressed = gzcompress($str,5);

WHAT is 5 USED FOR?

5 is used for compression level which is maximum 9
you may pass value 1 to 9. default is 0 which means no compression.



HOW TO UNCOMPRESS THE COMPRESSED VERSION OF STRING?

variable $compressed contains the compressed version of string variable $str;
we uncompress it and put the resulting string in $str.

$str=gzuncompress($compressed);

remember if you pass an uncompressed data to gzuncompress function it may return an error.


for more help on compress GZ files see tutorial
"Creating gz compressed files with php"



© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online