I have a 2D array in which first column holds page_id
and second column holds points
. The page_id
is int
value which corresponds to a page url in database and points
refers to points allotted to that page.
I want to display pages such as way that pages with highest points display first and viceversa.
So Example if
arr[0][0] => 2
arr[0][1] => 200
arr[1][0] => 3
arr[1][1] => 29
arr[2][0] => 4
arr[2][1] => 400
----------------------
page_id | points
____________________
2 | 200
3 | 29
4 | 400
----------------------------------
Should be sorted as
----------------------
page_id | points
____________________
4 | 400
2 | 200
3 | 29
----------------------------------