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
89 lines
2.4 KiB
XML
89 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.15 $ -->
|
|
<!-- EN-Revision: 1.12 Maintainer: dams Status: ready -->
|
|
<refentry id="function.krsort">
|
|
<refnamediv>
|
|
<refname>krsort</refname>
|
|
<refpurpose>
|
|
Trie un tableau en sens inverse et suivant les clés
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>krsort</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>krsort</function> trie le tableau <parameter>array</parameter>
|
|
en ordre inverse et suivant les clés, en maintenant la correspondance
|
|
entre les clés et les valeurs. Cette fonction est pratique pour
|
|
les tableaux associatifs.
|
|
</para>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>krsort</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fruits = array("d"=>"papaye","a"=>"orange","b"=>"banane","c"=>"ananas");
|
|
ksort($fruits);
|
|
foreach ($fruits as $key => $val) {
|
|
echo "$key = $val\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
fruits[a] = orange
|
|
fruits[b] = banane
|
|
fruits[c] = ananas
|
|
fruits[d] = papaye
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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>
|
|
<simpara>
|
|
Voir aussi
|
|
<function>asort</function>,
|
|
<function>arsort</function>,
|
|
<function>ksort</function>,
|
|
<function>sort</function>,
|
|
<function>natsort</function> et
|
|
<function>rsort</function>.
|
|
</simpara>
|
|
</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
|
|
-->
|