<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.bzip2.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.bzcompress.php',
    1 => 'bzcompress',
    2 => 'Compress a string into bzip2 encoded data',
  ),
  'up' => 
  array (
    0 => 'ref.bzip2.php',
    1 => 'Bzip2 Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.bzclose.php',
    1 => 'bzclose',
  ),
  'next' => 
  array (
    0 => 'function.bzdecompress.php',
    1 => 'bzdecompress',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/bzip2/functions/bzcompress.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.bzcompress" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bzcompress</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">bzcompress</span> &mdash; <span class="dc-title">Compress a string into bzip2 encoded data</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.bzcompress-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>bzcompress</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">$block_size</code><span class="initializer"> = 4</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$work_factor</code><span class="initializer"> = 0</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.integer.php" class="type int">int</a></span></span></div>

  <p class="simpara">
   <span class="function"><strong>bzcompress()</strong></span> compresses the given string and returns
   it as bzip2 encoded data.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.bzcompress-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">data</code></dt>
    <dd>
     <span class="simpara">
      The string to compress.
     </span>
    </dd>
   
   
    <dt><code class="parameter">block_size</code></dt>
    <dd>
     <span class="simpara">
      Specifies the blocksize used during compression and should be a number
      from 1 to 9 with 9 giving the best compression, but using more
      resources to do so.
     </span>
    </dd>
   
   
    <dt><code class="parameter">work_factor</code></dt>
    <dd>
     <span class="simpara">
      Controls how the compression phase behaves when presented with worst
      case, highly repetitive, input data.  The value can be between 0 and
      250 with 0 being a special case.
     </span>
     <span class="simpara">
      Regardless of the <code class="parameter">work_factor</code>, the generated
      output is the same.
     </span>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.bzcompress-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   The compressed string, or an error number if an error occurred.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.bzcompress-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 Compressing data</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">"sample data"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$bzstr </span><span style="color: #007700">= </span><span style="color: #0000BB">bzcompress</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">, </span><span style="color: #0000BB">9</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$bzstr</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.bzcompress-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.bzdecompress.php" class="function" rel="rdfs-seeAlso">bzdecompress()</a> - Decompresses bzip2 encoded data</span></li>
  </ul>
 </div>

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