Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 406 Bytes

compress-string-data.md

File metadata and controls

17 lines (12 loc) · 406 Bytes

Compress string or data

There are different methods available which use different algorithms to compress and decompress. e.g gzcompress, gzinflate, bzcompress,...

With gzcompress I was able to compress upto 530% of my string data.

gzcompress:

<?php
$compressed = gzcompress('Compress me', 9);
$decompress = gzuncompress($compressed);
echo $compressed."\n";
echo $decompress;
?>