amit


{ City } rajkot
< Country > india
* Profession * student
User No # 30877
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 6
Users Marked my Answers as Wrong # 0
Questions / { amit }
Questions Answers Category Views Company eMail




Answers / { amit }

Question { Rushmore Consultancy, 5040 }

How can I reverse sort an array keeping the correlation
between the index and value?


Answer

$fruits = array("d" => "lemon", "a" => "orange", "b" =>
"banana", "c" => "apple");
arsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>

OUTPUT

a = orange
d = lemon
b = banana
c = apple

Is This Answer Correct ?    6 Yes 0 No