<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.outcontrol.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.ob-get-clean.php',
    1 => 'ob_get_clean',
    2 => 'Get the contents of the active output buffer and turn it off',
  ),
  'up' => 
  array (
    0 => 'ref.outcontrol.php',
    1 => 'Output Control Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.ob-flush.php',
    1 => 'ob_flush',
  ),
  'next' => 
  array (
    0 => 'function.ob-get-contents.php',
    1 => 'ob_get_contents',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/outcontrol/functions/ob-get-clean.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ob-get-clean" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ob_get_clean</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ob_get_clean</span> &mdash; <span class="dc-title">Get the contents of the active output buffer and turn it off</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ob-get-clean-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ob_get_clean</strong></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">
   This function calls the output handler
   (with the <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-clean">PHP_OUTPUT_HANDLER_CLEAN</a></code></strong> and
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong> flags),
   discards it&#039;s return value,
   returns the contents of the active output buffer
   and turns off the active output buffer.
  </p>
  <p class="para">
   <span class="function"><strong>ob_get_clean()</strong></span> will fail
   without an active output buffer started with the
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-removable">PHP_OUTPUT_HANDLER_REMOVABLE</a></code></strong> flag.
  </p>
  <p class="para">
   <span class="function"><strong>ob_get_clean()</strong></span>
   will discard the contents of the active output buffer
   even if it was started without the
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cleanable">PHP_OUTPUT_HANDLER_CLEANABLE</a></code></strong> flag.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ob-get-clean-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">Questa funzione non contiene parametri.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ob-get-clean-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns the contents of the active output buffer on success
   or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
  <div class="caution"><strong class="caution">Attenzione</strong>
   <p class="simpara">
    <span class="function"><strong>ob_get_clean()</strong></span> will return false
    but will not generate an <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong>
    if there is no active output buffer.
   </p>
  </div>
 </div>


 <div class="refsect1 errors" id="refsect1-function.ob-get-clean-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  <p class="para">
   If the function fails it generates an <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ob-get-clean-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 A simple <span class="function"><strong>ob_get_clean()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />ob_start</span><span style="color: #007700">();<br /><br />echo </span><span style="color: #DD0000">"Hello World"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$out </span><span style="color: #007700">= </span><span style="color: #0000BB">ob_get_clean</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$out </span><span style="color: #007700">= </span><span style="color: #0000BB">strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$out</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$out</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(11) &quot;hello world&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ob-get-clean-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ob-start.php" class="function" rel="rdfs-seeAlso">ob_start()</a> - Turn on output buffering</span></li>
    <li><span class="function"><a href="function.ob-get-contents.php" class="function" rel="rdfs-seeAlso">ob_get_contents()</a> - Return the contents of the output buffer</span></li>
    <li><span class="function"><a href="function.ob-clean.php" class="function" rel="rdfs-seeAlso">ob_clean()</a> - Clean (erase) the contents of the active output buffer</span></li>
    <li><span class="function"><a href="function.ob-end-clean.php" class="function" rel="rdfs-seeAlso">ob_end_clean()</a> - Clean (erase) the contents of the active output buffer and turn it off</span></li>
    <li><span class="function"><a href="function.ob-get-flush.php" class="function" rel="rdfs-seeAlso">ob_get_flush()</a> - Flush (send) the return value of the active output handler,
   return the contents of the active output buffer and turn it off</span></li>
   </ul>
  </p>
 </div>


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