PHP Sort

Syntax: bool sort ( array &$array [, int $sort_flags = SORT_REGULAR ] )
Description: Sort an array

<?php
$fruits = array("lemon", "orange", "banana", "apple");
sort($fruits);
print_r($fruits);
?>

OUTPUT

Array ( 
[0] => apple 
[1] => banana 
[2] => lemon
 [3] => orange )

 

Leave a Reply

Your email address will not be published. Required fields are marked *