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 is data abstraction in php?
A company named Pensar Technologies in chennai has offered me a job as Software Trainee in chennai.But they are asking to pay demand draft of Rs.75000/- in the name of the company.They are saying the gross renumeration will pay Rs.90000/- annually.I want to know whether this is good or bad company?Help me out in this.
How is traits used in php?
What is the difference between explode () and split () functions in php?
Do you have to initialize variables in php?
How do I sort numbers in php?
Explain the visibility of the property or method?
How are Variables Defined in PHP?
Tell me what is the use of "ksort" in php?
What is the maximum size of a database in mysql?
Explain do you use composer? If yes, what benefits have you found in it?
What is phpsessid?