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 add to the end of an array and know how large the array is?I have the following list : Tom T1 Tom T2 Bill T1 Bill T2 Jack T1 Jack T2 I need it converted into : Tom T1,T2 Bill T1,T2 Jack T1,T2
I am not interested in the values in the arrays, how can I discard them?
How do I remove an element from an array without changing the index values for the rest of the array?
How do I pick a random value from an array?
