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;
?>
