Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 1530

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>krsort</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Array - funcþii"
HREF="ref.array.html"><LINK
REL="PREVIOUS"
TITLE="key"
HREF="function.key.html"><LINK
REL="NEXT"
TITLE="ksort"
HREF="function.ksort.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.key.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.ksort.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.krsort"
></A
>krsort</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN7509"
></A
><P
>    (PHP 3&#62;= 3.0.13, PHP 4 , PHP 5)</P
>krsort&nbsp;--&nbsp;Sort an array by key in reverse order</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN7512"
></A
><H2
>Description</H2
>int <B
CLASS="methodname"
>krsort</B
> ( array array [, int sort_flags])<BR
></BR
><P
>&#13;     Sorts an array by key in reverse order, maintaining key to data
     correlations. This is useful mainly for associative arrays.
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN7524"
></A
><P
><B
>Exemplu 1. <B
CLASS="function"
>krsort()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");<br />krsort ($fruits);<br />reset ($fruits);<br />while (list ($key, $val) = each ($fruits)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "$key = $val\n";<br />}</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     This example would display:
    </P
><P
>&#13;     <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="screen"
>d = lemon
c = apple
b = banana
a = orange</PRE
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     You may modify the behavior of the sort using the optional
     parameter <VAR
CLASS="parameter"
>sort_flags</VAR
>, for details
     see <A
HREF="function.sort.html"
><B
CLASS="function"
>sort()</B
></A
>.
    </P
><P
>&#13;     See also <A
HREF="function.asort.html"
><B
CLASS="function"
>asort()</B
></A
>, <A
HREF="function.arsort.html"
><B
CLASS="function"
>arsort()</B
></A
>,
     <A
HREF="function.ksort.html"
><B
CLASS="function"
>ksort()</B
></A
>, <A
HREF="function.sort.html"
><B
CLASS="function"
>sort()</B
></A
>,
     <A
HREF="function.natsort.html"
><B
CLASS="function"
>natsort()</B
></A
>, and <A
HREF="function.rsort.html"
><B
CLASS="function"
>rsort()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.key.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.ksort.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>key</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.array.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>ksort</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>