Forum : How to reverse sort the contents of an array?
Brief description  about Online courses   join in Online courses
View Arun  Desai 's Profile

How to reverse sort the contents of an array?

Hi,

How to reverse sort the contents of an array
Asked by Arun Desai | Mar 10, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Desai,

Answer to your question is simple,just use rsort()

For example:

<?php
$arr = array("you","are","how","hi,");
rsort($arr);
print_r($arr);
?>

printing to the screen:

Array
(
[0] => hi,
[1] => how
[2] => are
[3] => you
)
Mar 10, 2010