<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.array-search"> <refnamediv> <refname>array_search</refname> <refpurpose> Searches the array for a given value and returns the corresponding key if successful </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>mixed</type><methodname>array_search</methodname> <methodparam><type>mixed</type><parameter>needle</parameter></methodparam> <methodparam><type>array</type><parameter>haystack</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>strict</parameter></methodparam> </methodsynopsis> <para> Searches <parameter>haystack</parameter> for <parameter>needle</parameter> and returns the key if it is found in the array, &false; otherwise. </para> <note> <para> Prior to PHP 4.2.0, <function>array_search</function> returns <constant>NULL</constant> on failure instead of &false;. </para> </note> <para> If the optional third parameter <parameter>strict</parameter> is set to &true; then the <function>array_search</function> will also check the types of the <parameter>needle</parameter> in the <parameter>haystack</parameter>. </para> &return.falseproblem; <para> See also <function>array_keys</function> and <function>in_array</function>. </para> </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:"../../../../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 -->