| |
| * Link führt ins Internet |
|

| |
Befehl | Version | Beschreibung | Beispiel | Ausgabe |
Befehl
| bool krsort ( array &$array [, int $sort_flags] ) |
Version
Beschreibung
Die Funktion krsort() sortiert ein assoziatives Array (array) absteigend nach
den Schlüsseln. Die Beziehung zwischen Wert und Schlüssel bleibt erhalten. Im
Parameter sort_flags können Sie Flags für den Sortiertyp übergeben:
• SORT_REGULAR – Vergleicht die Felder normal (Default-Wert)
• SORT_NUMERIC – Vergleicht die Felder numerisch
• SORT_STRING – Vergleicht Felder als Strings
Siehe auch:
• asort()
• arsort()
• ksort()
• sort()
• natsort()
• rsort() |
Beispiel
<?PHP
$array = array ( 'a' => 'PHP', 'b' => 'ASP', 'c' => 'Perl' );
krsort ( $array );
reset ( $array );
print_r ( $array );
?>
|
Ausgabe
Array
(
[c] => Perl
[b] => ASP
[a] => PHP
)
| |
|
|
|
|
|


|