Jump to content


Array Multisort Function

  • Please log in to reply
No replies to this topic

#1 Mateobus

  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 14 August 2006 - 03:35 PM

I have the following information stored in an array:

$team[$team_count] = $team_name;
$conference_wins[$team_count] = $cw;
$conference_ties[$team_count] = $ct;
$conference_losses[$team_count] = $cl;
$goal_differential[$team_count] = $gf-$ga;
$goals_for[$team_count] = $gf;
$goals_against[$team_count] = $ga;
$conference_points[$team_count] =($cw*3)+($ct);

I want to use the array multisort to sort them as follows.  The first criterion for who is in first is based on who has the most conference points.  The next is who has the most goals differential, then goals for is the last tie breaker.  How can I do this with array_multisort, and are my arrays even set up the right way?  Do I need to pass every array to the array_multisort function or can I leave off team_name since it doesnt affect sorting. Any help is appreciated.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users