PHP - How to compress string

This could be handy for compressing JavaScript files or CSS (if you prefer using PHP for your build / release script).

$compressed = gzcompress($string);

Perhaps we can use those output buffering function (ob_start) to make the code more efficient.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License