PHP - Sorting an Array

WownElolo

New Member
I am trying to sort an array that contains numbers that range in substantial values. The result I want to get is a descending order of those numbers from the array I am retrieving from a MySQL Server. So far I have created this to test out the "sort" function:\[code\]<?php$numbers = array("100", "50", "70", "1000");sort($numbers);echo var_dump($numbers);?>\[/code\]And the result I get is this:\[code\]array(4) { [0]=> string(2) "50" [1]=> string(2) "70" [2]=> string(3) "100" [3]=> string(4) "1000" } \[/code\]I can see that the numbers are listing from smallest to largest, but I want it to list from the biggest integer to the smallest integer. Also I don't understand why it has text other than the integers. If anyone could help me out on this, I would greatly appreciate it.Thanks,Kevin
 
Back
Top