reference/array/functions/array-search.xml
2e60c5134e7a847c99f81eb3f7ecee1f5efeeace
...
...
@@ -8,7 +8,7 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>mixed</type><methodname>array_search</methodname>
11
+
<type class="union"><type>int</type><type>string</type><type>false</type></type><methodname>array_search</methodname>
12
12
<methodparam><type>mixed</type><parameter>needle</parameter></methodparam>
13
13
<methodparam><type>array</type><parameter>haystack</parameter></methodparam>
14
14
<methodparam choice="opt"><type>bool</type><parameter>strict</parameter><initializer>&false;</initializer></methodparam>
...
...
@@ -70,35 +70,10 @@
70
70
If <parameter>needle</parameter> is found in <parameter>haystack</parameter>
71
71
more than once, the first matching key is returned. To return the keys for
72
72
all matching values, use <function>array_keys</function> with the optional
73
-
<parameter>search_value</parameter> parameter instead.
73
+
<parameter>filter_value</parameter> parameter instead.
74
74
</para>
75
75
&return.falseproblem;
76
76
</refsect1>
77
-
<refsect1 role="changelog">
78
-
&reftitle.changelog;
79
-
<para>
80
-
<informaltable>
81
-
<tgroup cols="2">
82
-
<thead>
83
-
<row>
84
-
<entry>&Version;</entry>
85
-
<entry>&Description;</entry>
86
-
</row>
87
-
</thead>
88
-
<tbody>
89
-
<row>
90
-
<entry>5.3.0</entry>
91
-
<entry>
92
-
As with all internal PHP functions as of 5.3.0,
93
-
<function>array_search</function> returns &null; if invalid parameters
94
-
are passed to it.
95
-
</entry>
96
-
</row>
97
-
</tbody>
98
-
</tgroup>
99
-
</informaltable>
100
-
</para>
101
-
</refsect1>
102
77
<refsect1 role="examples">
103
78
&reftitle.examples;
104
79
<para>
...
...
@@ -110,7 +85,10 @@
110
85
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
111
86

112
87
$key = array_search('green', $array); // $key = 2;
88
+
print_r($key);
89
+

113
90
$key = array_search('red', $array); // $key = 1;
91
+
print_r($key);
114
92
?>
115
93
]]>
116
94
</programlisting>
...
...
@@ -129,7 +107,6 @@ $key = array_search('red', $array); // $key = 1;
129
107
</para>
130
108
</refsect1>
131
109
</refentry>
132
-

133
110
<!-- Keep this comment at the end of the file
134
111
Local variables:
135
112
mode: sgml
136
113