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
)
More arrays PHP Questions
How do I write my own sort function?How do I remove and view the last element of an array?
How can I sort an array keeping the correlation between the index and value?
How do I add to the beginning of an array and find the number of elements in it?
How do I find out if a value is already in an array?