mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document stream_filter_remove()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@168552 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e3f0875d7b
commit
35f1cd5a99
3 changed files with 96 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<refentry id="function.stream-filter-append">
|
||||
<refnamediv>
|
||||
<refname>stream_filter_append</refname>
|
||||
|
@ -8,7 +8,7 @@
|
|||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>stream_filter_append</methodname>
|
||||
<type>resource</type><methodname>stream_filter_append</methodname>
|
||||
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filtername</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>read_write</parameter></methodparam>
|
||||
|
@ -36,6 +36,13 @@
|
|||
<constant>STREAM_FILTER_ALL</constant> can also be passed to the
|
||||
<parameter>read_write</parameter> parameter to override this behavior.
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 5.1.0, this function returns a resource which
|
||||
can be used to refer to this filter instance during a call
|
||||
to <function>stream_filter_remove</function>.
|
||||
Prior to PHP 5.1.0, this function returns &true; on success
|
||||
or &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Controlling where filters are applied</title>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry id="function.stream-filter-prepend">
|
||||
<refnamediv>
|
||||
<refname>stream_filter_prepend</refname>
|
||||
|
@ -8,7 +8,7 @@
|
|||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>stream_filter_prepend</methodname>
|
||||
<type>resource</type><methodname>stream_filter_prepend</methodname>
|
||||
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filtername</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>read_write</parameter></methodparam>
|
||||
|
@ -38,6 +38,13 @@
|
|||
See <function>stream_filter_append</function> for an example of
|
||||
using this parameter.
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 5.1.0, this function returns a resource which
|
||||
can be used to refer to this filter instance during a call
|
||||
to <function>stream_filter_remove</function>.
|
||||
Prior to PHP 5.1.0, this function returns &true; on success
|
||||
or &false; on failure.
|
||||
</para>
|
||||
<note>
|
||||
<title>When using custom (user) filters</title>
|
||||
<simpara>
|
||||
|
|
78
reference/stream/functions/stream-filter-remove.xml
Normal file
78
reference/stream/functions/stream-filter-remove.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.stream-filter-remove">
|
||||
<refnamediv>
|
||||
<refname>stream_filter_remove</refname>
|
||||
<refpurpose>Remove a filter from a stream</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>stream_filter_append</methodname>
|
||||
<methodparam><type>resource</type><parameter>stream_filter</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Removes a stream filter previously added to a stream
|
||||
with <function>stream_filter_prepend</function> or
|
||||
<function>stream_filter_append</function>. Any data
|
||||
remaining in the filter's internal buffer will be flushed
|
||||
through to the next filter before removing it.
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
<title>Dynamicly refiltering a stream</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* Open a test file for reading and writing */
|
||||
$fp = fopen("test.txt", "rw");
|
||||
|
||||
$rot13_filter = stream_filter_append($fp, "string.rot13", STREAM_FILTER_WRITE);
|
||||
fwrite($fp, "This is ");
|
||||
stream_filter_remove($rot13_filter);
|
||||
fwrite($fp, "a test\n");
|
||||
|
||||
rewind($fp);
|
||||
fpassthru($fp);
|
||||
fclose($fp);
|
||||
|
||||
/* Expected Output
|
||||
---------------
|
||||
|
||||
Guvf vf a test
|
||||
|
||||
*/
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
See also
|
||||
<function>stream_filter_register</function>,
|
||||
<function>stream_filter_append</function>, and
|
||||
<function>stream_filter_prepend</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
Loading…
Reference in a new issue