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.

Recommended Answers

All 3 Replies

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.