-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathfilter-input-array.xml
More file actions
128 lines (122 loc) · 4.95 KB
/
filter-input-array.xml
File metadata and controls
128 lines (122 loc) · 4.95 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 53054bf8decc8648cf2e90a493692a161e2371af Maintainer: mumumu Status: ready -->
<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>
成功した場合は要求された変数の値を含む配列。
</simpara>
<simpara>
失敗した場合、&false; を返します。
<parameter>type</parameter> で指定された入力値の配列が得られなかった場合、
かつ <constant>FILTER_NULL_ON_FAILURE</constant> フラグが指定されていた場合は、
例外的に &null; を返します。
</simpara>
<simpara>
入力された配列に欠けているエントリがあった場合、
<parameter>add_empty</parameter> が &true; のときは返される配列に追加されます。
この場合、欠けているエントリには、<constant>FILTER_NULL_ON_FAILURE</constant>
を使わない限り &null; が設定されます。
<constant>FILTER_NULL_ON_FAILURE</constant> を使った場合には、&false; が設定されます。
</simpara>
<simpara>
フィルタが失敗した場合、配列の値は &false; になります。
但し、<constant>FILTER_NULL_ON_FAILURE</constant> が使われている場合を除きます。
使われている場合、配列の値は &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
-->