-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathfilter-input-array.xml
More file actions
114 lines (108 loc) · 4.26 KB
/
filter-input-array.xml
File metadata and controls
114 lines (108 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 53054bf8decc8648cf2e90a493692a161e2371af Maintainer: mowangjuanzi Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xml:id="function.filter-input-array" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>filter_input_array</refname>
<refpurpose>获取一系列外部变量,并且可以通过过滤器处理它们</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>array</type><type>false</type><type>null</type></type><methodname>filter_input_array</methodname>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>array</type><type>int</type></type><parameter>options</parameter><initializer><constant>FILTER_DEFAULT</constant></initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>add_empty</parameter><initializer>&true;</initializer></methodparam>
</methodsynopsis>
<para>
这个函数当需要获取很多变量却不想重复调用<function>filter_input</function>时很有用。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<simpara>
<constant>INPUT_<replaceable>*</replaceable></constant> 常量之一。
</simpara>
<warning>
<simpara>
在用户对超全局变量进行任何修改之前,正在过滤的超全局变量内容是 <acronym>SAPI</acronym>
提供的“原始”内容。要过滤修改后的超全局变量,请使用 <function>filter_var_array</function>。
</simpara>
</warning>
</listitem>
</varlistentry>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('function.filter-var-array')/db:refsect1[@role='parameters']//db:varlistentry[db:term[db:parameter[text()='options']]]/.)">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('function.filter-var-array')/db:refsect1[@role='parameters']//db:varlistentry[db:term[db:parameter[text()='add_empty']]]/.)">
<xi:fallback/>
</xi:include>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
成功时,返回 &array;,包含所请求变量的值。
</simpara>
<simpara>
失败时返回 &false;。有一个失败的例外情况,就是 <parameter>type</parameter> 指定的输入数组没有填充,并且使用了
<constant>FILTER_NULL_ON_FAILURE</constant> flag 时,返回 &null;。
</simpara>
<simpara>
如果 <parameter>add_empty</parameter> 为 &true;,则输入数组中缺失的条目会填充到返回数组中,并且缺失的条目将设置为
&null;。
</simpara>
<simpara>
如果过滤失败,则返回 &array; 中的条目将为 &false;,当使用了 <constant>FILTER_NULL_ON_FAILURE</constant> flag 时为 &null;。
</simpara>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
在 <constant>INPUT_SERVER</constant> 数组中并没有 <literal>REQUEST_TIME</literal> ,因为它是被稍后插入到 <varname>$_SERVER</varname> 中的。
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>filter_input</function></member>
<member><function>filter_var</function></member>
<member><function>filter_var_array</function></member>
<member>
验证过滤器
<constant>FILTER_VALIDATE_<replaceable>*</replaceable></constant>
</member>
<member>
清理过滤器
<constant>FILTER_SANITIZE_<replaceable>*</replaceable></constant>
</member>
</simplelist>
</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:"~/.phpdoc/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
-->