Gzcompress() and gzuncompress() function() :

Gzcompress() and gzuncompress() function() :

We can use gzcompress() and gzuncompress() to compress/decompress large strings before storing them in a database. These built-in functions use the gzip algorithm and can compress plaintext up to 90%.

gzcompress() :string gzcompress ( string data [, int length] )

string gzcompress ( string data [, int length] )Example :

<?php
$compressed_text = gzcompress(’This is Compressed text’, 9);
echo $compressed_text;
?>

gzuncompress() :string gzuncompress ( string data [, int length] )

string gzuncompress ( string data [, int length] )Example :

<?php
$compressed_input = gzcompress(’Compress text’, 9);
$uncompressed = gzuncompress($compressed_input);
echo $uncompressed;
?>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.