Text compression for JavaScript and PHP
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/294297/javascript-implementation-of-gzip">JavaScript implementation of Gzip</a>  </p>
</blockquote>



<p>I'm looking for a text (string) compression method that works in JavaScript and PHP, similarly to how it works in JSON. I do not know if there is a similar technology.</p>

<p>For example, I would like to compress text with JavaScript and then decompress it afterwards with PHP in another page.</p>

<p>I apologize in advance if this post seems to be a duplicate, but I have searched and have not found anything similar to what I need. I only found functions that work exclusively in one technology (PHP or JavaScript, not in both.
one example:</p>

<pre><code>&lt;script&gt;
var text=aaaaa;
 text=functionForCompress(text){}
 text-&gt; for example 5a
&lt;script&gt;
</code></pre>

<p>in a page php:</p>

<pre><code>$decompresedText=functionForDeCompress(request-&gt;data);
$decompresedText -&gt; aaaaa
</code></pre>

<p>request->data contains variable text of script</p>
