Tuesday, July 14, 2009

Reverse sort an array

$myworld = array("a"=>"PHP","b"=>"learning","c"=>"I'm");
krsort($myworld);
print_r($myworld);
?>


Which confirms your suspicions:

Array
(
[c] => I'm
[b] => learning
[a] => PHP
)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home