Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2040


What are the advantages of indexes in php?

1032


What types of Data Can Be Used as Array Keys?

1019


What is the use of $_server["php_self"] variable?

996


What is the default session out time?

1078


Which variable declarations within a class is invalid in php?

963


Tell me what are the different types of errors in php?

976


What is ci framework in php?

1005


What is static variable in php?

1082


What do you mean range() in php?

1088


What are the differences between GET and POST methods?

1063


What are the methods to submit form in php?

1001


What does it mean when it says the csrf token is invalid?

895


What is Gd PHP?

968


What is the difference between print() and echo() in PHP?

1040