mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-24 09:08:13 +02:00
9c92b20ccb
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@118985 c90b9560-bf6c-de11-be94-00142212c4b1
84 lines
2.5 KiB
XML
84 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./fr/functions/array.xml, last change in rev 1.30 -->
|
|
<!-- last change to 'arsort' in en/ tree in rev 1.2 -->
|
|
<refentry id="function.arsort">
|
|
<refnamediv>
|
|
<refname>arsort</refname>
|
|
<refpurpose>
|
|
Trie un tableau en ordre inverse
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
<function>arsort</function> trie un tableau 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.
|
|
<example>
|
|
<title>Exemple avec <function>arsort</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fruits = array("d"=>"papaye","a"=>"orange","b"=>"banane","c"=>"ananas");
|
|
arsort ($fruits);
|
|
for (reset ($fruits); $key = key($fruits); next($fruits)) {
|
|
echo "fruits[$key] = ".$fruits[$key]."\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
Cet exemple va afficher:
|
|
<computeroutput>
|
|
<![CDATA[
|
|
fruits[d] = papaye
|
|
fruits[a] = orange
|
|
fruits[b] = banane
|
|
fruits[c] = ananas
|
|
]]>
|
|
</computeroutput>
|
|
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 le manuel pour 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
|
|
-->
|