1
0
mirror of https://github.com/php/doc-zh.git synced 2026-03-26 16:12:19 +01:00
Files
archived-doc-zh/reference/array/functions/array-key-exists.xml
Dallas Wang 580b23e287 Translation completed.
git-svn-id: https://svn.php.net/repository/phpdoc/zh/trunk@94824 c90b9560-bf6c-de11-be94-00142212c4b1
2002-09-06 06:33:42 +00:00

66 lines
1.8 KiB
XML
Executable File

<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready -->
<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>
<function>array_key_exists</function> 在给定的 <parameter>key</parameter>
存在于数组中时返回 &true;<parameter>key</parameter>
可以是任何能作为数组索引的值。
</para>
<para>
<example>
<title><function>array_key_exists</function> 例子</title>
<programlisting role="php">
<![CDATA[
$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>
<para>
参见 <function>isset</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
-->