How to Compress data using gzcompress() in PHP

Spread the love

Compress data using gzcompress() in PHP

When working with strings, it is not uncommon that some are long. Utilizing the gzcompress() work, strings can be compacted. To uncompressed it, just call the gzuncompress(). It diminishes string size as should be obvious in underneath capacity I will exhibit gzcompress() capacity to lessen string size which help to upgrade your script.

In the above example you can see the after using gzcompress() function, string size reduced almost 50% and you can easily get original string back by simply using gzuncompress() in php.

Leave a Reply

Your email address will not be published. Required fields are marked *