mirror of
https://github.com/php/doc-de.git
synced 2026-03-25 15:52:10 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@297032 c90b9560-bf6c-de11-be94-00142212c4b1
161 lines
3.9 KiB
XML
161 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: wiesemann Status: ready -->
|
|
<!-- CREDITS: tom -->
|
|
<refentry xml:id="function.array-key-exists" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_key_exists</refname>
|
|
<refpurpose>Prüft, ob ein Schlüssel in einem Array existiert</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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> gibt &true; zurück, wenn
|
|
<parameter>key</parameter> in dem Array vorhanden ist.
|
|
<parameter>key</parameter> kann jeder für einen Array-Index
|
|
mögliche Wert sein.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>key</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Der zu prüfende Wert.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>search</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Ein Array mit den zu prüfenden Schlüsseln.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.3.0</entry>
|
|
<entry>
|
|
Diese Funktion arbeitet nicht mehr mit Objekten.
|
|
<function>property_exists</function> sollte in diesem Fall
|
|
genutzt werden.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>array_key_exists</function>-Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$search_array = array('erstes' => 1, 'zweites' => 4);
|
|
if (array_key_exists('erstes', $search_array)) {
|
|
echo "Das Element 'erstes' ist in dem Array vorhanden";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Der Name dieser Funktion ist in PHP 4.0.6
|
|
<function>key_exists</function>.
|
|
</simpara>
|
|
</note>
|
|
<example>
|
|
<title><function>array_key_exists</function> vs. <function>isset</function></title>
|
|
<para>
|
|
<function>isset</function> gibt nicht &true; zurück für Schlüssel eines
|
|
Arrays, die zu einem &null;-Wert gehören,
|
|
<function>array_key_exists</function> tut dies hingegen.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$search_array = array('erstes' => null, 'zweites' => 4);
|
|
|
|
// Gibt false zurück
|
|
isset($search_array['erstes']);
|
|
|
|
// Gibt true zurück
|
|
array_key_exists('erstes', $search_array);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>isset</function></member>
|
|
<member><function>array_keys</function></member>
|
|
<member><function>in_array</function></member>
|
|
<member><function>property_exists</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|