mirror of
https://github.com/php/doc-de.git
synced 2026-03-26 16:22:10 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@261299 c90b9560-bf6c-de11-be94-00142212c4b1
100 lines
3.4 KiB
XML
100 lines
3.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- EN-Revision: 1.3 Maintainer: nobody Status: ready -->
|
|
<refentry xml:id="function.array-intersect-key" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_intersect_key</refname>
|
|
<refpurpose>Ermittelt die Schnittmenge von Arrays, indem es die
|
|
Schlüssel vergleicht</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_intersect_key</methodname>
|
|
<methodparam><type>array</type><parameter>array1</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>array2</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter> ...</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_intersect_key</function> gibt ein Array zurück, welches
|
|
alle Werte von <parameter>array1</parameter> enthält, die Schlüssel
|
|
besitzen die in allen anderen Argumente enthalten sind.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>array_intersect_key</function> Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array1 = array('blau' => 1, 'rot' => 2, 'grün' => 3, 'violett' => 4);
|
|
$array2 = array('grün' => 5, 'blau' => 6, 'gelb' => 7, 'türkis' => 8);
|
|
|
|
var_dump(array_intersect_key($array1, $array2));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
array(2) {
|
|
["blau"]=>
|
|
int(1)
|
|
["grün"]=>
|
|
int(3)
|
|
})
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
In unserem Beispiel sehen Sie, dass nur die Schlüssel
|
|
<literal>'blau'</literal> und <literal>'grün'</literal> in beiden Arrays
|
|
vorhanden sind und daher zurückgegeben werden. <literal>'blue'</literal>
|
|
und <literal>'grün'</literal> haben unterschiedliche Werte. Eine
|
|
Übereinstimmung wird dennoch festgestellt, da nur die Schlüssel geprüft werden.
|
|
Die zurückgegebenen Werte sind diejenigen aus <parameter>array1</parameter>.
|
|
</para>
|
|
<para>
|
|
Die beiden Schlüssel des <literal>Schlüssel => Wert</literal> Paares
|
|
werden als gleich erachtet, genau dann wenn <literal>(string) $key1 ===
|
|
(string) $key2 </literal>. Anders ausgedrückt findet eine strikte Prüfung
|
|
statt, in der die String-Repräsentationen gleich sein müssen.
|
|
</para>
|
|
<para>
|
|
Siehe auch <function>array_diff</function>,
|
|
<function>array_udiff</function>
|
|
<function>array_diff_assoc</function>,
|
|
<function>array_diff_uassoc</function>,
|
|
<function>array_udiff_assoc</function>,
|
|
<function>array_udiff_uassoc</function>,
|
|
<function>array_diff_key</function>,
|
|
<function>array_diff_ukey</function>,
|
|
<function>array_intersect</function>,
|
|
<function>array_intersect_assoc</function>,
|
|
<function>array_intersect_uassoc</function> und
|
|
<function>array_intersect_ukey</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
|
|
-->
|