<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.zlib.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.gzcompress.php',
    1 => 'gzcompress',
    2 => 'Komprimiert einen String',
  ),
  'up' => 
  array (
    0 => 'ref.zlib.php',
    1 => 'Zlib-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.gzclose.php',
    1 => 'gzclose',
  ),
  'next' => 
  array (
    0 => 'function.gzdecode.php',
    1 => 'gzdecode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/zlib/functions/gzcompress.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gzcompress" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gzcompress</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gzcompress</span> &mdash; <span class="dc-title">Komprimiert einen String</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.gzcompress-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gzcompress</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$level</code><span class="initializer"> = -1</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="zlib.constants.php#constant.zlib-encoding-deflate">ZLIB_ENCODING_DEFLATE</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Diese Funktion komprimiert den gegebenen String mittels des
   <code class="literal">ZLIB</code>-Datenformats.
  </p>
  <p class="para">
   Details zum ZLIB-Kompressionsalgorithmus finden Sie im Dokument
   &quot;<a href="https://datatracker.ietf.org/doc/html/rfc1950" class="link external">&raquo;&nbsp;ZLIB Compressed Data Format
   Specification version 3.3</a>&quot; (RFC 1950).
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Dies entspricht <em>nicht</em> der gzip-Kompression,
    welche zusätzliche Kopfdaten enthält. Für gzip-Kompression
    nutzen Sie bitte <span class="function"><a href="function.gzencode.php" class="function">gzencode()</a></span>.
   </p>
  </p></blockquote>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.gzcompress-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       Die zu komprimierenden Daten.
      </p>
     </dd>
    
    
     <dt><code class="parameter">level</code></dt>
     <dd>
      <p class="para">
       Der Kompressionsgrad. Dieser reicht von 0 für keine Kompression
       bis 9 für maximale Kompression.
      </p>
      <p class="para">
       Wird -1 angegeben, wird die Standardkompression der zlib-Bibliothek
       verwendet, die 6 ist.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       Eine der
       <strong><code><a href="zlib.constants.php#constant.zlib-encoding-raw">ZLIB_ENCODING_<span class="replaceable">*</span></a></code></strong>-Konstanten.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.gzcompress-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Der komprimierte String oder <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, falls ein Fehler aufgetreten ist.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.gzcompress-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>gzcompress()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$compressed </span><span style="color: #007700">= </span><span style="color: #0000BB">gzcompress</span><span style="color: #007700">(</span><span style="color: #DD0000">'Komprimiere mich'</span><span style="color: #007700">, </span><span style="color: #0000BB">9</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$compressed</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.gzcompress-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.gzdeflate.php" class="function" rel="rdfs-seeAlso">gzdeflate()</a> - Komprimiert eine Zeichenkette</span></li>
    <li><span class="function"><a href="function.gzinflate.php" class="function" rel="rdfs-seeAlso">gzinflate()</a> - Dekomprimiert eine komprimierte Zeichenkette</span></li>
    <li><span class="function"><a href="function.gzuncompress.php" class="function" rel="rdfs-seeAlso">gzuncompress()</a> - Dekomprimiert einen komprimierten String</span></li>
    <li><span class="function"><a href="function.gzencode.php" class="function" rel="rdfs-seeAlso">gzencode()</a> - Create a gzip compressed string</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>