Jump to content

Array Multisort Function


Mateobus

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.