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