mirror of
https://github.com/php/doc-de.git
synced 2026-03-29 10:42:12 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@133570 c90b9560-bf6c-de11-be94-00142212c4b1
89 lines
2.4 KiB
XML
89 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- EN-Revision: 1.6 Maintainer: tom Status: ready -->
|
|
<refentry id="function.arsort">
|
|
<refnamediv>
|
|
<refname>arsort</refname>
|
|
<refpurpose>
|
|
Sortiert ein Array in umgekehrter Reihenfolge und behält die
|
|
Verbindung zum Index
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Beschreibung</title>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>arsort</methodname>
|
|
<methodparam><type>array</type><parameter>array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>sort_flags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Diese Funktion sortiert ein Array so, dass der Zusammenhang zwischen
|
|
den Indizes und den entsprechenden Arrayelementen erhalten bleibt.
|
|
Dies wird hauptsächlich bei assoziativen Arrays verwendet, bei denen
|
|
die aktuelle Reihenfolge der Elemente bedeutend ist.
|
|
</para>
|
|
<example>
|
|
<title><function>arsort</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fruits = array ("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel");
|
|
arsort ($fruits);
|
|
reset ($fruits);
|
|
while (list ($key, $val) = each ($fruits)) {
|
|
echo "$key = $val\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Dieses Beispiel würde folgendes ausgeben:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
d = Zitrone
|
|
a = Orange
|
|
b = Banane
|
|
c = Apfel
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<para>
|
|
Die Früchte wurden in umgekehrter alphabetischer Reihenfolge
|
|
sortiert, und die Zuordnung zwischen Index und Element blieb
|
|
beibehalten.
|
|
</para>
|
|
<para>
|
|
Sie können das Verhalten der Sortierung mittels dem optionalen
|
|
Parameter <parameter>sort_flags</parameter> beeinflussen, für
|
|
Details siehe <function>sort</function>.
|
|
</para>
|
|
<para>
|
|
Siehe auch <function>asort</function>,
|
|
<function>rsort</function>, <function>ksort</function> und
|
|
<function>sort</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
|
|
-->
|