mirror of
https://github.com/php/doc-de.git
synced 2026-03-24 15:22:14 +01:00
fixed svn properties git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@283886 c90b9560-bf6c-de11-be94-00142212c4b1
96 lines
3.2 KiB
XML
96 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: n/a Maintainer: nobody Status: ready -->
|
|
<refentry xml:id="function.array-intersect-assoc" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_intersect_assoc</refname>
|
|
<refpurpose>Ermittelt die Schnittmenge von Arrays mit Indexprüfung</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_intersect_assoc</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>
|
|
<simpara>
|
|
<function>array_intersect_assoc</function> gibt ein Array mit allen Werten
|
|
von <parameter>array1</parameter>, die auch in allen anderen Argumenten
|
|
enthalten sind, zurück. Beachten Sie, dass anders als von
|
|
<function>array_intersect</function> die Schlüssel zum Vergleich
|
|
herangezogen werden.
|
|
</simpara>
|
|
<para>
|
|
<example>
|
|
<title><function>array_intersect_assoc</function> Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array1 = array("a" => "grün", "b" => "braun", "c" => "blau", "rot");
|
|
$array2 = array("a" => "grün", "gelb", "rot");
|
|
$result_array = array_intersect_assoc($array1, $array2);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
$result_array wird wie folgt aussehen:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[a] => grün
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<simpara>
|
|
In unserem Beispiel sehen Sie, dass einzig das Paar <literal>"a" =>
|
|
"green"</literal> in beiden Arrays enthalten ist und daher zurückgegeben
|
|
wird. Der Wert <literal>"rot"</literal> wird nicht zurückgegeben, weil
|
|
sein Schlüsselwert in <varname>$array1</varname> <literal>0</literal> ist,
|
|
wohingegen der Schlüssel von "rot" in <varname>$array2</varname> den Wert
|
|
<literal>1</literal> hat.
|
|
</simpara>
|
|
<simpara>
|
|
Die beiden Werte des <literal>Schlüssel => Wert</literal> Paares werden
|
|
als gleich erachtet, genau dann wenn <literal>(string) $elem1 ===
|
|
(string) $elem2 </literal>. Anders ausgedrückt wird eine strikte
|
|
Typenprüfung durchgeführt, so dass die Stringrepresentation gleich sein
|
|
muss.
|
|
<!-- TODO: example of it... -->
|
|
</simpara>
|
|
<simpara>
|
|
Siehe auch <function>array_intersect</function>,
|
|
<function>array_uintersect_assoc</function>,
|
|
<function>array_intersect_uassoc</function>,
|
|
<function>array_uintersect_uassoc</function>,
|
|
<function>array_diff</function> und
|
|
<function>array_diff_assoc</function>.
|
|
</simpara>
|
|
</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
|
|
-->
|