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
125 lines
4.3 KiB
XML
125 lines
4.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- splitted from ./en/functions/array.xml, last change in rev 1.14 -->
|
|
<!-- EN-Revision: n/a Maintainer: nobody Status: ready -->
|
|
<refentry xml:id="function.array-diff-uassoc" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_diff_uassoc</refname>
|
|
<refpurpose>Berechnet den Unterschied von Arrays mit zusätzlicher Indexprüfung,
|
|
welche durch eine benutzerdefinierte Funktion vorgenommen wird</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_diff_uassoc</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>
|
|
<methodparam><type>callback</type><parameter>key_compare_func</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_diff_uassoc</function> gibt ein <type>array</type> zurück,
|
|
welches alle Werte aus <parameter>array1</parameter> enthält, die in keinem
|
|
der anderen Argumente enthalten sind. Beachten Sie, dass die Schlüssel anders
|
|
als von <function>array_diff</function> in den Vergleich einbezogen werden.
|
|
</para>
|
|
<para>
|
|
Dieser Vergleich wird von einer benutzerdefinierten Callbackfunktion
|
|
durchgeführt. Diese muss einen Integer kleiner als, genau gleich oder
|
|
größer als Null zurückgeben, wenn das erste Argument entsprechend als
|
|
kleiner, gleich oder größer als das Zweite betrachtet wird. Dies ist anders
|
|
als <function>array_diff_assoc</function>, in der eine eingebaute Funktion
|
|
für den Vergleich der Indizes verwendet wird.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>array_diff_uassoc</function> Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
function key_compare_func($a, $b)
|
|
{
|
|
if ($a === $b) {
|
|
return 0;
|
|
}
|
|
return ($a > $b)? 1:-1;
|
|
}
|
|
|
|
$array1 = array("a" => "gruen", "b" => "braun", "c" => "blau", "rot");
|
|
$array2 = array("a" => "gruen", "gelb", "rot");
|
|
$result = array_diff_uassoc($array1, $array2, "key_compare_func");
|
|
print_r($result);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[b] => braun
|
|
[c] => blau
|
|
[0] => rot
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<simpara>
|
|
In unserem obigen Beispiel sieht man dass das
|
|
<literal>"a" => "gruen"</literal> Paar in beiden Arrays enthalten ist
|
|
und daher nicht in der Ausgabe der Funktion auftaucht. Andererseits ist das
|
|
Paar <literal>0 => "rot"</literal> in der Ausgabe, weil
|
|
<literal>"red"</literal> im zweiten Argument einen Schlüsselwert von
|
|
<literal>1</literal> enthält.
|
|
</simpara>
|
|
<simpara>
|
|
Die Gleichheit von zwei Indizes wird von einer benutzerdefinierten
|
|
Callbackfunktion überprüft.
|
|
</simpara>
|
|
<note>
|
|
<simpara>
|
|
Bitte beachten Sie, dass diese Funktion nur eine Dimension eines
|
|
n-dimensionalen Arrays prüft. Natürlich kann man tiefere Dimensionen
|
|
überprüfen, indem man zum Beispiel
|
|
<literal>array_diff_uassoc($array1[0], $array2[0], "key_compare_func");</literal>
|
|
verwendet.
|
|
</simpara>
|
|
</note>
|
|
<para>
|
|
Siehe auch
|
|
<function>array_diff</function>,
|
|
<function>array_diff_assoc</function>,
|
|
<function>array_udiff</function>,
|
|
<function>array_udiff_assoc</function>,
|
|
<function>array_udiff_uassoc</function>,
|
|
<function>array_intersect</function>,
|
|
<function>array_intersect_assoc</function>,
|
|
<function>array_uintersect</function>,
|
|
<function>array_uintersect_assoc</function> und
|
|
<function>array_uintersect_uassoc</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
|
|
-->
|