How do I reverse sort an array by key?
You guessed it... krsort - getting good at this PHP lark now!
Here's the obligatory quick example:
$myworld = array("a"=>"PHP","b"=>"learning","c"=>"I'm");
Which confirms your suspicions:
[c] => I'm
[b] => learning
[a] => PHP
More arrays PHP QuestionsHow can I loop through the members of an array?
How do we sort an array of names taken from a text file, displaying only unique names?
How can I easily view all members of an array?
I have an array of a hundred or so lines, each line has data with "|" separated values. I need to scan through this array, and select the line whose first 5 characters matches a text string. Any ideas or questions?
how can you reset an array in PHP