mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-27 10:46:12 +02:00
88c52a26f0
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@114768 c90b9560-bf6c-de11-be94-00142212c4b1
88 lines
2.6 KiB
XML
88 lines
2.6 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 'krsort' in en/ tree in rev 1.2 -->
|
|
<refentry id="function.krsort">
|
|
<refnamediv>
|
|
<refname>krsort</refname>
|
|
<refpurpose>
|
|
Trie un tableau en sens inverse et suivant les clés
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>krsort</methodname>
|
|
<methodparam><type>array</type><parameter>array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>sort_flags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>krsort</function> trie un tableau 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.
|
|
<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);
|
|
for(reset($fruits); $key = key($fruits); next($fruits)) {
|
|
echo "fruits[$key] = ".$fruits[$key]."\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
Cet exemple va afficher :
|
|
<computeroutput>
|
|
<![CDATA[
|
|
fruits[a] = orange
|
|
fruits[b] = banane
|
|
fruits[c] = ananas
|
|
fruits[d] = papaye
|
|
]]>
|
|
</computeroutput>
|
|
</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>array-multisort</function>,
|
|
<function>arsort</function>,
|
|
<function>asort</function>,
|
|
<function>ksort</function>,
|
|
<function>natsort</function>,
|
|
<function>natcasesort</function>,
|
|
<function>rsort</function>,
|
|
<function>sort</function>,
|
|
<function>uasort</function>,
|
|
<function>uksort</function> et
|
|
<function>usort</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
|
|
-->
|