1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-25 23:52:16 +01:00
Files
archived-doc-ja/reference/array/functions/array-key-exists.xml
Hideyuki Shimooka 9a0fa05272 Translation updated
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@185696 c90b9560-bf6c-de11-be94-00142212c4b1
2005-05-03 08:48:56 +00:00

96 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.6 $ -->
<!-- EN-Revision: 1.11 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka -->
<refentry id="function.array-key-exists">
<refnamediv>
<refname>array_key_exists</refname>
<refpurpose>
指定したキーまたは添字が配列にあるかどうかを調べる
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>bool</type><methodname>array_key_exists</methodname>
<methodparam><type>mixed</type><parameter>key</parameter></methodparam>
<methodparam><type>array</type><parameter>search</parameter></methodparam>
</methodsynopsis>
<para>
指定した<parameter>key</parameter>が配列に設定されている場合、
<function>array_key_exists</function>&true;を返します。
<parameter>key</parameter>は配列添字として使用できる全ての
値を使用可能です。<function>array_key_exists</function>
オブジェクトに対しても動作します。
</para>
<para>
<example>
<title><function>array_key_exists</function>の例</title>
<programlisting role="php">
<![CDATA[
<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
echo "The 'first' element is in the array";
}
?>
]]>
</programlisting>
</example>
</para>
<note>
<simpara>
この関数の名前は、PHP 4.0.6では
<function>key_exists</function>です。
</simpara>
</note>
<example>
<title><function>array_key_exists</function><function>isset</function></title>
<para>
<function>isset</function>&null; 値を持つ配列キーに対して
&true; を返しません。一方、<function>array_key_exists</function>
&true; を返します。
</para>
<programlisting role="php">
<![CDATA[
<?php
$search_array = array('first' => null, 'second' => 4);
// false を返す
isset($search_array['first']);
// true を返す
array_key_exists('first', $search_array);
?>
]]>
</programlisting>
</example>
<para>
<function>isset</function>,
<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
-->