PHP compression and decompression string method, PHP decompression string
The example in this article describes how PHP compresses and decompress strings. Share to everyone for your reference. Specific as follows:
The following PHP code compresses and compresses strings through gzcompress and gzuncompress, and can set the compression level
$str = ' Hello I am a very very very very long string '; $compressed = Gzcompress ($str, 9);//Compression level = 9$uncompressed = Gzuncompre SS ($compressed), echo $str, "\ n", echo $uncompressed, "\ n", Echo Base64_encode ($compressed), "\ n"; Echo Bin2Hex ($ compressed), "\ n"; Echo UrlEncode ($compressed), "\ n";
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/967742.html www.bkjia.com true http://www.bkjia.com/PHPjc/967742.html techarticle PHP Compression and decompression of the string method, PHP decompression string Examples of this article describes the PHP compression and decompression of the string method. Share to everyone for your reference. Specific as follows: The following ...