How can I reverse sort an array keeping the correlation
between the index and value?
Answers were Sorted based on User's Feedback
Answer / 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 |
How can you propagate a session id?
Is laravel frontend or backend?
Single choice objective PHP question...
What are getters and setters php?
Which one is best framework for php?
Whether session will work if we disable cookies in client browser ?
What is the use of print_r function in php?
Which is a perfect example of runtime polymorphism?
What is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
What is orm in php framework?
Tell me what does pear stands for?
Explain Traits in PHP?