Source of: /manual/en/function.ob-list-handlers.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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 => 'en',
),
'this' =>
array (
0 => 'function.ob-list-handlers.php',
1 => 'ob_list_handlers',
),
'up' =>
array (
0 => 'ref.outcontrol.php',
1 => 'Output Control Functions',
),
'prev' =>
array (
0 => 'function.ob-implicit-flush.php',
1 => 'ob_implicit_flush',
),
'next' =>
array (
0 => 'function.ob-start.php',
1 => 'ob_start',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.ob-list-handlers" class="refentry">
<div class="refnamediv">
<h1 class="refname">ob_list_handlers</h1>
<p class="verinfo">(PHP 4 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">ob_list_handlers</span> — <span class="dc-title">List all output handlers in use</span></p>
</div>
<a name="function.ob-list-handlers.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><b>ob_list_handlers</b></span>
( <span class="methodparam">void</span>
)</div>
<p class="para rdfs-comment">
Lists all output handlers in use.
</p>
</div>
<a name="function.ob-list-handlers.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
This will return an array with the output handlers in use (if any). If
<a href="outcontrol.configuration.php#ini.output-buffering" class="link">output_buffering</a> is enabled or
an anonymous function was used with <a href="function.ob-start.php" class="function">ob_start()</a>,
<b>ob_list_handlers()</b> will return "default output
handler".
</p>
</div>
<a name="function.ob-list-handlers.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>ob_list_handlers()</b> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">//using output_buffering=On<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">ob_list_handlers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">ob_end_flush</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">ob_start</span><span style="color: #007700">(</span><span style="color: #DD0000">"ob_gzhandler"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">ob_list_handlers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">ob_end_flush</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// anonymous functions<br /></span><span style="color: #0000BB">ob_start</span><span style="color: #007700">(</span><span style="color: #0000BB">create_function</span><span style="color: #007700">(</span><span style="color: #DD0000">'$string'</span><span style="color: #007700">, </span><span style="color: #DD0000">'return $string;'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">ob_list_handlers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">ob_end_flush</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
<div class="example-contents para"><p>The above example will output:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[0] => default output handler
)
Array
(
[0] => ob_gzhandler
)
Array
(
[0] => default output handler
)
</pre></div>
</div>
</div><p>
</p>
</div>
<a name="function.ob-list-handlers.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.ob-end-clean.php" class="function" rel="rdfs-seeAlso">ob_end_clean()</a> - Clean (erase) the output buffer and turn off output buffering</li>
<li class="member"><a href="function.ob-end-flush.php" class="function" rel="rdfs-seeAlso">ob_end_flush()</a> - Flush (send) the output buffer and turn off output buffering</li>
<li class="member"><a href="function.ob-get-flush.php" class="function" rel="rdfs-seeAlso">ob_get_flush()</a> - Flush the output buffer, return it as a string and turn off output buffering</li>
<li class="member"><a href="function.ob-start.php" class="function" rel="rdfs-seeAlso">ob_start()</a> - Turn on output buffering</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>