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 |
What are the steps for the payment gateway processing?
Is learning php easy?
What is the method to execute a php script from the command line?
Swap two variables value without using third variable in php ?
Are php variables global?
What types of Data Can Be Used as Array Keys?
What is a static variable in php?
How can we submit form without a submit button?
Is nan in php?
Tell me what is the difference between the functions strstr() and stristr()?
How can we display information of a variable and readable by a human with php?
How can we register the variables into a Session?
7 Answers HCL, Star Computers, Trikon Networks,