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

What are the uses of implode() function?

1087


What is the difference between php and javascript?

1177


Where is the submitted form data stored?

1079


Explain mixed and callback functions?

1125


What are the advantages of stored procedures, triggers, indexes in php?

1032


Tell me what is the difference between the functions strstr() and stristr()?

1053


Are php sessions secure?

977


Tell me what is the main difference between php 4 and php 5?

990


Why do you need to filter out empty files?

920


Which function would you use to merge two arrays in php?

978


How to create a session? How to set a value in session? How to remove data from a session?

976


What is htmlentities function in php?

956


What is data type in php?

1049


What is super () python?

1026


What is $this in php?

979