How can I reverse sort an array keeping the correlation
between the index and value?
Answer Posted / jude jeevanraj.p
This is done using the arsort function:
<?php
$myworld = array
("a"=>"everything","b"=>"nothing","c"=>"is");
arsort($myworld);
print_r($myworld);
?>
Which prints this:
Array
(
[b] => nothing
[c] => is
[a] => everything
)
| Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
What does csrf token mean?
How do I see how many pages per session in google analytics?
How to create an empty array in php?
Why php is widely used?
How do you end a function in python?
How do I sort numbers in php?
What is a static variable in php?
What is strcmp () in php?
what does this symbol mean in php?
Name some of the functions in php.
What is sql injection in php?
What is self in php?
How to execute a php script from the command line?
What does mvc stand for and what does each component do?
Explain what is memcache?