reference/filter/functions/filter-var-array.xml
de9c65c91ff1710d8b2d2ec955caea0162679305
...
...
@@ -8,9 +8,10 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>mixed</type><methodname>filter_var_array</methodname>
12
-
<methodparam><type>array</type><parameter>data</parameter></methodparam>
13
-
<methodparam choice="opt"><type>mixed</type><parameter>definition</parameter></methodparam>
11
+
<type class="union"><type>array</type><type>false</type><type>null</type></type><methodname>filter_var_array</methodname>
12
+
<methodparam><type>array</type><parameter>array</parameter></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>array</type><type>int</type></type><parameter>options</parameter><initializer><constant>FILTER_DEFAULT</constant></initializer></methodparam>
14
+
<methodparam choice="opt"><type>bool</type><parameter>add_empty</parameter><initializer>&true;</initializer></methodparam>
14
15
</methodsynopsis>
15
16
<para>
16
17
This function is useful for retrieving many values without
...
...
@@ -22,7 +23,7 @@
22
23
<para>
23
24
<variablelist>
24
25
<varlistentry>
25
-
<term><parameter>data</parameter></term>
26
+
<term><parameter>array</parameter></term>
26
27
<listitem>
27
28
<para>
28
29
An array with string keys containing the data to filter.
...
...
@@ -30,18 +31,18 @@
30
31
</listitem>
31
32
</varlistentry>
32
33
<varlistentry>
33
-
<term><parameter>definition</parameter></term>
34
+
<term><parameter>options</parameter></term>
34
35
<listitem>
35
36
<para>
36
37
An array defining the arguments. A valid key is a <type>string</type>
37
-
containing a variable name and a valid value is either a filter type,
38
-
or an <type>array</type> optionally specifying the filter, flags and
39
-
options. If the value is an array, valid keys are
40
-
<literal>filter</literal> which specifies the filter type,
38
+
containing a variable name and a valid value is either a
39
+
<link linkend="filter.filters">filter type</link>, or an
40
+
<type>array</type> optionally specifying the filter, flags and options.
41
+
If the value is an array, valid keys are <literal>filter</literal>
42
+
which specifies the <link linkend="filter.filters">filter type</link>,
41
43
<literal>flags</literal> which specifies any flags that apply to the
42
-
filter, and <literal>options</literal> which specifies any options
43
-
that apply to the filter. See the example below for a better
44
-
understanding.
44
+
filter, and <literal>options</literal> which specifies any options that
45
+
apply to the filter. See the example below for a better understanding.
45
46
</para>
46
47
<para>
47
48
This parameter can be also an integer holding a <link
...
...
@@ -50,6 +51,14 @@
50
51
</para>
51
52
</listitem>
52
53
</varlistentry>
54
+
<varlistentry>
55
+
<term><parameter>add_empty</parameter></term>
56
+
<listitem>
57
+
<para>
58
+
Add missing keys as &null; to the return value.
59
+
</para>
60
+
</listitem>
61
+
</varlistentry>
53
62
</variablelist>
54
63
</para>
55
64
</refsect1>
...
...
@@ -70,7 +79,7 @@
70
79
<programlisting role="php">
71
80
<![CDATA[
72
81
<?php
73
-
error_reporting(E_ALL | E_STRICT);
82
+

74
83
$data = array(
75
84
'product_id' => 'libgd<script>',
76
85
'component' => '10',
...
...
@@ -110,20 +119,14 @@ echo "\n";
110
119
<![CDATA[
111
120
array(6) {
112
121
["product_id"]=>
113
-
array(1) {
114
-
[0]=>
115
-
string(17) "libgd%3Cscript%3E"
116
-
}
122
+
string(17) "libgd%3Cscript%3E"
117
123
["component"]=>
118
124
array(1) {
119
125
[0]=>
120
126
int(10)
121
127
}
122
128
["versions"]=>
123
-
array(1) {
124
-
[0]=>
125
-
string(6) "2.0.33"
126
-
}
129
+
string(6) "2.0.33"
127
130
["doesnotexist"]=>
128
131
NULL
129
132
["testscalar"]=>
...
...
@@ -147,12 +150,12 @@ array(6) {
147
150
<member><function>filter_input_array</function></member>
148
151
<member><function>filter_var</function></member>
149
152
<member><function>filter_input</function></member>
153
+
<member><xref linkend="filter.filters"/></member>
150
154
</simplelist>
151
155
</para>
152
156
</refsect1>
153
157

154
158
</refentry>
155
-

156
159
<!-- Keep this comment at the end of the file
157
160
Local variables:
158
161
mode: sgml
159
162