View Single Post
Old 08-25-2009, 10:24 AM   #1 (permalink)
Hightower
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default Sorting an Array

Hey folks,

I have an array like this:
Code:
Array ( 
	[1] => Array ( 
		[team_name] => Steelers FC 
		[played] => 2 
		[points] => 4
		[won] => 1 
		[drawn] => 1 
		[lost] => 0 
		[for] => 5 
		[against] => 3 
		[goal_difference] => 2 
	) [2] => Array ( 
		[team_name] => Bishop Middleham 
		[played] => 2 
		[points] => 1 
		[won] => 0 
		[drawn] => 1 
		[lost] => 1 
		[for] => 3 
		[against] => 5 
		[goal_difference] => -2 
	) 
)
I need to sort it like a league table, so:

Points DESC,
For DESC,
Goal diff DESC

Anybody know how I would achieve this?

The final array might have 12/13/14 different entries in it rather than just the two shown.
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote