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

How we get browser details of clients machine?

967


What is the difference between explode() and split() functions?

968


What is faster in php?

1005


what is constructor

1554


How variables are passed through arguments?

898


How to submit form without a submit button.

995


Which software is best for php?

947


Is php used for frontend or backend?

960


What is the difference between get & post ?

1029


Does php have block scope?

906


How to remove duplicate values from a PHP Array?

1004


What are different types of Print Functions available in PHP?

902


Does cors prevent csrf?

887


What is action hooks and filter hooks?

842


What is php built on?

913