mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-27 10:22:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@189706 c90b9560-bf6c-de11-be94-00142212c4b1
90 lines
2.4 KiB
XML
90 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.17 $ -->
|
|
<!-- EN-Revision: 1.12 Maintainer: didou Status: ready -->
|
|
<refentry id="function.arsort">
|
|
<refnamediv>
|
|
<refname>arsort</refname>
|
|
<refpurpose>Trie un tableau en ordre inverse</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>arsort</methodname>
|
|
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>sort_flags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>arsort</function> trie le tableau <parameter>array</parameter>
|
|
de telle manière que la corrélation entre les index et les valeurs soit
|
|
conservée. L'usage principal est lors de tri de tableaux
|
|
associatifs où l'ordre des éléments est important.
|
|
</para>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>arsort</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
|
|
arsort($fruits);
|
|
foreach ($fruits as $key => $val) {
|
|
echo "$key = $val\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
a = orange
|
|
d = lemon
|
|
b = banana
|
|
c = apple
|
|
]]>
|
|
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Les fruits ont été triés en ordre alphabétique
|
|
inverse, et leurs index respectifs ont été conservés.
|
|
</para>
|
|
<para>
|
|
Vous pouvez modifier le comportement de cette fonction en utilisant
|
|
le paramètre optionnel <parameter>sort_flags</parameter>. Pour plus
|
|
de détails, voyez la fonction <function>sort</function>.
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>asort</function>,
|
|
<function>rsort</function>,
|
|
<function>ksort</function> et
|
|
<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
|
|
-->
|