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
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
What are the advantages of indexes in php?
What types of Data Can Be Used as Array Keys?
What is the use of $_server["php_self"] variable?
What is the default session out time?
Which variable declarations within a class is invalid in php?
Tell me what are the different types of errors in php?
What is ci framework in php?
What is static variable in php?
What do you mean range() in php?
What are the differences between GET and POST methods?
What are the methods to submit form in php?
What does it mean when it says the csrf token is invalid?
What is Gd PHP?
What is the difference between print() and echo() in PHP?