954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sorting Multidimensional array

Hi,

I want to be able to sort a multidimensional array using its second dimension to sort the first. It is a list of sporting teams with points stored like this:

$teams[$teamnumber]['points']
$teams[$teamnumber]['players']
$teams[$teamnumber]['name']

These teams are to be shown in a league table which is why they needed to be sorted in descending order of points, however the data must not be mismatched or teams may end up with the wrong name, players etc.

mcatominey
Newbie Poster
10 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 
chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
 

I've just looked at that but i'm not sure that it would help, I only want to sort the array using one Keys values not multiple fields.

mcatominey
Newbie Poster
10 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Edit: I've fixed it now with your solution, Cheers.

mcatominey
Newbie Poster
10 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: