Source of: /manual/en/function.stream-filter-remove.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.stream.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.stream-filter-remove.php',
1 => 'stream_filter_remove',
),
'up' =>
array (
0 => 'ref.stream.php',
1 => 'Stream Functions',
),
'prev' =>
array (
0 => 'function.stream-filter-register.php',
1 => 'stream_filter_register',
),
'next' =>
array (
0 => 'function.stream-get-contents.php',
1 => 'stream_get_contents',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.stream-filter-remove" class="refentry">
<div class="refnamediv">
<h1 class="refname">stream_filter_remove</h1>
<p class="verinfo">(PHP 5 >= 5.1.0)</p><p class="refpurpose"><span class="refname">stream_filter_remove</span> — <span class="dc-title">Remove a filter from a stream</span></p>
</div>
<a name="function.stream-filter-remove.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><b>stream_filter_remove</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$stream_filter</tt></span>
)</div>
<p class="para rdfs-comment">
Removes a stream filter previously added to a stream with
<a href="function.stream-filter-prepend.php" class="function">stream_filter_prepend()</a> or
<a href="function.stream-filter-append.php" class="function">stream_filter_append()</a>. Any data remaining in the
filter's internal buffer will be flushed through to the next filter before
removing it.
</p>
</div>
<a name="function.stream-filter-remove.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">stream_filter</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The stream filter to be removed.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.stream-filter-remove.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
<a name="function.stream-filter-remove.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 Dynamicly refiltering a stream</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">/* Open a test file for reading and writing */<br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"test.txt"</span><span style="color: #007700">, </span><span style="color: #DD0000">"rw"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$rot13_filter </span><span style="color: #007700">= </span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"string.rot13"</span><span style="color: #007700">, </span><span style="color: #0000BB">STREAM_FILTER_WRITE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"This is "</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_remove</span><span style="color: #007700">(</span><span style="color: #0000BB">$rot13_filter</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"a test\n"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fpassthru</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /><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>
Guvf vf a test
</pre></div>
</div>
</div><p>
</p>
</div>
<a name="function.stream-filter-remove.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.stream-filter-register.php" class="function" rel="rdfs-seeAlso">stream_filter_register()</a> - Register a user defined stream filter</li>
<li class="member"><a href="function.stream-filter-append.php" class="function" rel="rdfs-seeAlso">stream_filter_append()</a> - Attach a filter to a stream</li>
<li class="member"><a href="function.stream-filter-prepend.php" class="function" rel="rdfs-seeAlso">stream_filter_prepend()</a> - Attach a filter to a stream</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>