1
0
mirror of https://github.com/php/doc-de.git synced 2026-04-26 00:18:07 +02:00
Files
archived-doc-de/reference/array/functions/asort.xml
T
Hartmut Holzgraefe b7c32fa3e7 entity fix
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@255503 c90b9560-bf6c-de11-be94-00142212c4b1
2008-03-19 18:56:41 +00:00

87 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- EN-Revision: 1.14 Maintainer: simp Status: ready -->
<!-- CREDITS: tom -->
<refentry xml:id="function.asort" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>asort</refname>
<refpurpose>Sortiert ein Array und behält die Indexverbindungen</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>asort</methodname>
<methodparam><type>array</type><parameter role="reference">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>
<para>
&return.success;
</para>
<example>
<title><function>asort</function></title>
<programlisting role="php">
<![CDATA[
<?php
$fruits = array("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel");
asort ($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
c = Apfel
b = Banane
a = Orange
d = Zitrone
]]>
</screen>
</example>
<para>
Die Früchte wurden alphabetisch 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>arsort</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
-->