I have array echo this: (2 5 7 13 19 22 23 37 41 41 64 74 85 96 139);
But I need this echo: (139 96 85 74 64 41 41 37 23 22 19 13 7 5 2);
I can't find, how to upside down echo value?
$num= array(7,13,85,64,2,41,22,96,139,37,41,19,74,23,5);
$max= max($num);
$a= count($num);
sort($num);
for ($x=0; $x < $a; $x++) {
echo $num[$x]. " ";
}
output: 2 5 7 13 19 22 23 37 41 41 64 74 85 96 139