Sort the elements of numbers array in descending numerical order in PHP

Description

The following code shows how to sort the elements of numbers array in descending numerical order.

Example


//from  ww w .ja v  a  2s.  c o  m
<?php
    $numbers=array(4,6,2,22,11);
    rsort($numbers);
?>




















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone