06.11.2016, 00:25
If you meant values in an array you can easily sort them in descending order.There are lot of sorting methods available.I will show you simple sorting technique (Linear sort)
There are also more optimized algorithms for sorting like insertion,bubble,shell etc.You can ****** about it
PHP код:
new i,j,a;
for (i = 0; i < sizeof(number);i++)
{
for (j = i + 1; j < sizeof(number); j++)
{
if (number[i] < number[j])//to sort in reverse (ascending change < to >)
{
a = number[i];
number[i] = number[j];
number[j] = a;
}
}
}