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 are the uses of implode() function?
What is the difference between php and javascript?
Where is the submitted form data stored?
Explain mixed and callback functions?
What are the advantages of stored procedures, triggers, indexes in php?
Tell me what is the difference between the functions strstr() and stristr()?
Are php sessions secure?
Tell me what is the main difference between php 4 and php 5?
Why do you need to filter out empty files?
Which function would you use to merge two arrays in php?
How to create a session? How to set a value in session? How to remove data from a session?
What is htmlentities function in php?
What is data type in php?
What is super () python?
What is $this in php?