Jump to content

Archived

This topic is now archived and is closed to further replies.

Mateobus

Array Multisort Function

Recommended Posts

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);
$team_count++;

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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.