JavaScript string compression + PHP decompression

I am looking for a solution to compress a string in JavaScript, send it using GET (jsonp) and unzip it back using PHP. It would be best to have fast code and good compression.

I found the lz-string library, but it looks like it does not have a PHP backend. Any other similar libraries or PHP implementation of lz-string?

+4
source share
2 answers

You can try - http://rosettacode.org/wiki/LZW_compression , which has an implementation in JavaScript, php and other languages.

+1
source

javascript , :

https://github.com/dankogai/js-deflate

PHP-, gzinflate()

Gotchas

  • POST , , base64 . gzinflate (base64_decode ($ post_body));

  • javascript deflate, PHP 100% , , , gzinflate . , , - : POSTing . .

  • , javascript.

  • (100+ ), , (IE <= 9), , ( setTimeout) . JS- 100 , , JS-timeout.

0

All Articles