How can I reverse sort an array keeping the correlation between the index and value?
<?php
$myworld = array("a"=>"everything","b"=>"nothing","c"=>"is");
arsort($myworld);
print_r($myworld);
?>
Which prints this:
Array
(
[b] => nothing
[c] => is
[a] => everything
)
Comment on this Question and Answer >>>
ASK A QUESTION
More arrays PHP Questions
How do I reverse sort an array by key?How can I display values in a two dimensional array?
How can I check if a value is already in an array?
How do I find the size of an array?
How do I return all the values in an array?
