Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 6050

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Remove a filter from a stream</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.stream-filter-register.html">stream_filter_register</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.stream-get-contents.html">stream_get_contents</a></div>
 <div class="up"><a href="ref.stream.html">Stream Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.stream-filter-remove" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_filter_remove</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">stream_filter_remove</span> &mdash; <span class="dc-title">Remove a filter from a stream</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.stream-filter-remove-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>stream_filter_remove</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream_filter</code></span>
   )</div>

  <p class="para rdfs-comment">
   Removes a stream filter previously added to a stream with
    <span class="function"><a href="function.stream-filter-prepend.html" class="function">stream_filter_prepend()</a></span> or
    <span class="function"><a href="function.stream-filter-append.html" class="function">stream_filter_append()</a></span>.  Any data remaining in the
   filter&#039;s internal buffer will be flushed through to the next filter before
   removing it.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-filter-remove-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">stream_filter</code></em></span>
     <dd>

      <p class="para">
       The stream filter to be removed.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-filter-remove-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.stream-filter-remove-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4019">
    <p><strong>Example #1 Dynamicly refiltering a stream</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Open&nbsp;a&nbsp;test&nbsp;file&nbsp;for&nbsp;reading&nbsp;and&nbsp;writing&nbsp;*/<br /></span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"test.txt"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"rw"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$rot13_filter&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"string.rot13"</span><span style="color: #007700">,&nbsp;</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">,&nbsp;</span><span style="color: #DD0000">"This&nbsp;is&nbsp;"</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">,&nbsp;</span><span style="color: #DD0000">"a&nbsp;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">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><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>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.stream-filter-remove-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.stream-filter-register.html" class="function" rel="rdfs-seeAlso">stream_filter_register()</a> - Register a user defined stream filter</span></li>
    <li class="member"> <span class="function"><a href="function.stream-filter-append.html" class="function" rel="rdfs-seeAlso">stream_filter_append()</a> - Attach a filter to a stream</span></li>
    <li class="member"> <span class="function"><a href="function.stream-filter-prepend.html" class="function" rel="rdfs-seeAlso">stream_filter_prepend()</a> - Attach a filter to a stream</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.stream-filter-register.html">stream_filter_register</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.stream-get-contents.html">stream_get_contents</a></div>
 <div class="up"><a href="ref.stream.html">Stream Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>