Skip to content

tamaspanczel/FifaWorldCupGroupStandingCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

FIFA World Cup Group Standing Calculator

Simple PHP script to calculate World Cup tiebreakers in group stage.

Resources:

Supported tournaments:

  • 2018 FIFA World Cup

Usage:

$teams = ['POL', 'SEN', 'COL', 'JAP'];

$matches = [
  [['team' => 'COL', 'goals' => 1, 'yellow' => 2, 'red' => 1, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'JAP', 'goals' => 2, 'yellow' => 1, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],

  [['team' => 'POL', 'goals' => 1, 'yellow' => 1, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'SEN', 'goals' => 2, 'yellow' => 2, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],

  [['team' => 'JAP', 'goals' => 2, 'yellow' => 2, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'SEN', 'goals' => 2, 'yellow' => 3, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],

  [['team' => 'POL', 'goals' => 0, 'yellow' => 2, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'COL', 'goals' => 3, 'yellow' => 0, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],

  [['team' => 'JAP', 'goals' => 0, 'yellow' => 1, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'POL', 'goals' => 1, 'yellow' => 0, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],

  [['team' => 'SEN', 'goals' => 0, 'yellow' => 1, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0],
   ['team' => 'COL', 'goals' => 1, 'yellow' => 1, 'red' => 0, 'ired' => 0, 'yellowred' => 0, 'extra' => 0]],
];

$group = [
  'teams' => $teams,
  'matches' => $matches,
];

$calc = new FifaWorldCupGroupStandingCalculator($group);
$standing = $calc->getStanding();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages