How to use arsort() array method in php programming language.
Code for sort-associative-array-descending-value.php file.
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Sort associative array in descending order in PHP according to value</title> </head> <body> <?php $name = array("Ram"=>"89", "Shyam"=>"88", "Anil"=>"86"); arsort($name); foreach($name as $a => $a_value) { echo "Key=" . $a . ", Value=" . $a_value . '</br>'; } ?> </body> </html>
Screenshot: