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 |
How can we do user authentication without using session/cookies ? For ex:- From page1 accepts user name and password and need to check in all other pages whether the user has logged in or not
How to get ip address of a server in php?
How to pad an array with the same value multiple times?
What are the steps for the payment gateway processing?
Are static variables final?
Whether it is possible to share a single instance of a memcache between multiple php projects?
What are the different ways we can retrive the mysql results using php ? Explain each
What is the difference between unlink and unset ?
can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.
How to Retrieve the Session ID of the Current Session?
What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
What is __ construct in php?