mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document built-in filters and their accepted parameters.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@155431 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
2d27832cb7
commit
db1d163ebe
1 changed files with 203 additions and 0 deletions
203
appendices/filters.xml
Normal file
203
appendices/filters.xml
Normal file
|
@ -0,0 +1,203 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<appendix id="filters">
|
||||
<title>List of Built-In Filters</title>
|
||||
<para>
|
||||
The following is a list of a few built-in stream filters for
|
||||
use with <function>stream_filter_append</function>.
|
||||
Your version of PHP may have more filters (or fewer) than those
|
||||
listed here.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is worth noting a slight asymmetry between
|
||||
<function>stream_filter_append</function>
|
||||
and <function>stream_filter_prepend</function>.
|
||||
Every PHP stream contains a small <emphasis>read buffer</emphasis>
|
||||
where it stores blocks of data retrieved from the
|
||||
filesystem or other resource in order to process data
|
||||
in the most efficient manner. As soon as data is pulled
|
||||
from the resource into the stream's internal buffer, it
|
||||
is immediately processed through any attached filters whether
|
||||
the PHP application is actually ready for the data or not.
|
||||
If data is sitting in the read buffer when a filter is
|
||||
<emphasis>appended</emphasis>, this data will be immediately
|
||||
processed through that buffer making the fact that is was
|
||||
sitting in the buffer seem transparent. However, if data is
|
||||
sitting in the read buffer when a filter is
|
||||
<emphasis>prepended</emphasis>, this data will <emphasis>NOT</emphasis>
|
||||
be processed through that filter. It will instead wait until
|
||||
the next block of data is retrieved from the resource.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For a list of filters installed in your version of
|
||||
<literal>PHP</literal> use <function>stream_get_filters</function>.
|
||||
</para>
|
||||
|
||||
<section id="filters.string">
|
||||
<title>String Filters</title>
|
||||
|
||||
<simpara>
|
||||
Each of these filters does precisely what their name implies and
|
||||
correspond to the behavior of a built-in php string handling function.
|
||||
For more information on a given filter, refer to the manual page for
|
||||
the corresponding function.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<table>
|
||||
<title>
|
||||
String Filters
|
||||
</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>PHP Function equivalent</entry>
|
||||
<entry>Since Version</entry>
|
||||
<entry>Parameters</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>string.rot13</literal></entry>
|
||||
<entry>
|
||||
<function>str_rot13</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 4.3.0</literal></entry>
|
||||
<entry>None</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>string.toupper</literal></entry>
|
||||
<entry>
|
||||
<function>strtoupper</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>None</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>string.tolower</literal></entry>
|
||||
<entry>
|
||||
<function>strtolower</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>None</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>string.strip_tags</literal></entry>
|
||||
<entry>
|
||||
<function>strip_tags</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>
|
||||
String containing allowable tags, similar to second parameter of <function>strip_tags</function>.
|
||||
May also be an array containing list of tags (excluding <> symbols).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="filters.convert">
|
||||
<title>Conversion Filters</title>
|
||||
|
||||
<simpara>
|
||||
Like the string.* filters, the convert.* filters perform actions
|
||||
similar to their names.
|
||||
For more information on a given filter, refer to the manual page for
|
||||
the corresponding function.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<table>
|
||||
<title>
|
||||
Convert Filters
|
||||
</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Name</entry>
|
||||
<entry>PHP Function equivalent</entry>
|
||||
<entry>Since Version</entry>
|
||||
<entry>Parameters</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>convert.base64-encode</literal></entry>
|
||||
<entry>
|
||||
<function>base64_encode</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>
|
||||
If parameters are provided as an associative array,
|
||||
<literal>convert.base64-encode</literal> will insert the value of
|
||||
<literal>$parameters['line-break-chars']</literal> every <literal>$parameters['line-length']</literal>
|
||||
characters of base64 output. This allow automatic formatting of encoded output
|
||||
otherwise acheived using <function>chunk_split</function>.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>convert.base64-decode</literal></entry>
|
||||
<entry>
|
||||
<function>base64_decode</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>None</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>convert.quoted-printable-encode</literal></entry>
|
||||
<entry>
|
||||
None. This is the counterpart to quoted-pritnable-decode.
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>
|
||||
<literal>line-break-chars</literal> and <literal>line-length</literal> are supported
|
||||
in the same manner as <literal>convert.base64-encode</literal> above. In addition,
|
||||
<literal>binary</literal> and <literal>force-encode-first</literal> are supported as
|
||||
boolean values which default to &false;.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>convert.quoted-printable-decode</literal></entry>
|
||||
<entry>
|
||||
<function>quoted_printable_decode</function>
|
||||
</entry>
|
||||
<entry><literal>PHP 5.0.0</literal></entry>
|
||||
<entry>
|
||||
If <literal>line-break-chars</literal> were specified during the encoding process,
|
||||
they should be specified here again in order to be stripped out for a successful decode.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
|
||||
<!-- 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