Sort the elements of the $numbers array in ascending numerical order in PHP

Description

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

Example


  /*from   w ww  . j a v a2s.  c  om*/
<?php
    $numbers=array(4,6,2,22,11);
    sort($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