Added search_array().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@41533 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sebastian Bergmann 2001-02-20 06:01:36 +00:00
parent 6b9df7290d
commit 8d47e43d5d

View file

@ -1818,6 +1818,41 @@ if (in_array(1.13, $a, true))
</programlisting>
</example>
</para>
<para>
See also <function>search_array</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.search-array">
<refnamediv>
<refname>search_array</refname>
<refpurpose>Searches the array for a given value and returns the corresponding key if successful</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>mixed search_array</funcdef>
<paramdef>mixed <parameter>needle</parameter></paramdef>
<paramdef>array <parameter>haystack</parameter></paramdef>
<paramdef>bool <parameter>strict</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Searches <parameter>haystack</parameter> for
<parameter>needle</parameter> and returns the key if it is found in
the array, false otherwise.
</para>
<para>
If the third parameter <parameter>strict</parameter> is set to
<literal>TRUE</literal> then the <function>search_array</function>
will also check the types of the <parameter>needle</parameter>
in the <parameter>haystack</parameter>.
</para>
<para>
See also <function>in_array</function>.
</para>
</refsect1>
</refentry>