Search found 2 matches
- Sat Oct 29, 2005 2:38 pm
- Forum: PHP - Code
- Topic: Array ordering with a twist
- Replies: 2
- Views: 155
Unfortunately usort() is just too simple for this application. I need to order the records in a football (soccer) league table firstly by points (which could be done by usort), but then some records may have the same value for the points field, in which case they must be sorted by the goal_differenc...
- Sat Oct 29, 2005 10:33 am
- Forum: PHP - Code
- Topic: Array ordering with a twist
- Replies: 2
- Views: 155
Array ordering with a twist
I have the following array: Array ( [0] => Team Object ( [id] => 0 [name] => Redgate [played] => 4 [won] => 2 [drawn] => 1 [lost] => 1 [points] => 7 [goals_for] => 12 [goals_against] => 8 [goal_difference] => 4 ) [1] => Team Object ( [id] => 1 [name] => Formby [played] => 4 [won] => 1 [drawn] => 1 [...