bool krsort ( array &$array [, int $sort_flags = SORT_REGULAR ] )
Sort an array by key in reverse order
Sorts an array by key in reverse order, maintaining key to data correlations. This is useful mainly for associative arrays.
<?php
$fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
krsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>
Kurs PHP i MySQL Lekcja 36 - Sortowanie tablic; użycie sort, asort, ksort, rsort, arsort, krsort
0 Comment:
Post a Comment