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 |
Tools used for drawing er diagrams?
Is php an object or array?
What is dao in php?
Can I write php code in html file?
What are static variables in php?
What is the difference between file_get_contents() and file_put_contents() in php?
Explain me what is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?
How do I run a php program in dreamweaver?
Which is better php or nodejs?
How we get ip address of client, previous reference page etc?
Why post method is used in php?
Tell me what does the php error 'parse error in php - unexpected t_variable at line x' means?