rsort and arsort
Basically both the functions are used to sort an array
But the differnce is arsort will maintain keys after sorting has performed, rsort won’t maintain keys.
Example
$arr = array(”one”=>1,”two”=>2,”three”=>3);
rsort($arr);
print_r($arr);
It will produce the folowing result
Array ( [0] => 3 [1] => 2 [2] => 1 )
$arr = array(”one”=>1,”two”=>2,”three”=>3);
rsort($arr);
print_r($arr);
It will produce the folowing result
Array ( [three] => 3 [two] => 2 [one] => 1 )
