Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am sure that you looked into <a href="http://php.net/manual/en/function.gzcompress.php" rel="nofollow">http://php.net/manual/en/function.gzcompress.php</a></p> <p>make sure that you have php version <strong>PHP 4 >= 4.0.1, PHP 5</strong> </p> <pre><code> string gzcompress ( string $data [, int $level = -1 [, int $encoding = ZLIB_ENCODING_DEFLATE ]] ) </code></pre> <p>This function compress the given string using the ZLIB data format.</p> <p>For details on the ZLIB compression algorithm see the document "» <a href="http://www.faqs.org/rfcs/rfc1950.html" rel="nofollow">ZLIB Compressed Data Format Specification version 3.3</a>" (RFC 1950). </p> <pre><code>&lt;?php $compressed = gzcompress('Compress me', 9); echo $compressed; ?&gt; </code></pre> <blockquote> <p><strong>Note:</strong></p> <p>This is not the same as gzip compression, which includes some header data. See gzencode() for gzip compression.</p> </blockquote> <p><strong>Parameters</strong></p> <blockquote> <p>data</p> <pre><code>The data to compress. </code></pre> </blockquote> <p><strong>level</strong></p> <blockquote> <p>The level of compression. Can be given as 0 for no compression up to 9 for maximum compression.</p> <pre><code>If -1 is used, the default compression of the zlib library is used which is 6. </code></pre> </blockquote> <p><strong>encoding</strong></p> <blockquote> <p>One of ZLIB_ENCODING_* constants.</p> </blockquote> <p><strong>gzencode — Create a gzip compressed string</strong> </p> <pre><code>&lt;?php $data = implode("", file("bigfile.txt")); $gzdata = gzencode($data, 9); $fp = fopen("bigfile.txt.gz", "w"); fwrite($fp, $gzdata); fclose($fp); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload