mirror of
https://github.com/php/doc-ja.git
synced 2026-03-26 08:02:15 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@134667 c90b9560-bf6c-de11-be94-00142212c4b1
63 lines
2.0 KiB
XML
63 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- sync: 1.4 -->
|
|
<refentry id="function.array-search">
|
|
<refnamediv>
|
|
<refname>array_search</refname>
|
|
<refpurpose>
|
|
指定した値を配列で検索し、見つかった場合に対応するキーを返す
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>説明</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>
|
|
<parameter>haystack</parameter>において
|
|
<parameter>needle</parameter>を検索し、配列中に見付かった場合にそ
|
|
のキーを返します。そうでない場合に&false;を返します。
|
|
</para>
|
|
<note>
|
|
<para>
|
|
PHP 4.2.0以前では、<function>array_search</function> は、
|
|
失敗した場合に&false;ではなく<constant>NULL</constant>を返します。
|
|
</para>
|
|
</note>
|
|
<para>
|
|
オプションの3番目のパラメータ<parameter>strict</parameter>に
|
|
&true;が指定された場合、<function>array_search</function>は
|
|
<parameter>haystack</parameter>の中で
|
|
<parameter>needle</parameter>の型に一致するかどうかも確認します。
|
|
</para>
|
|
&return.falseproblem;
|
|
<para>
|
|
<function>array_keys</function> および
|
|
<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
|
|
-->
|