A PHP class which implements the Elo rating system
PHP
Switch branches/tags
Nothing to show
Latest commit 209ff63 Jun 23, 2017 @Chovanec committed on GitHub Merge pull request #3 from Sysix/master
Improve Code Quality and add Constants for Score
Permalink
Failed to load latest commit information.
src/Rating simplify constructor Jun 23, 2017
AUTHORS Update AUTHORS Jun 30, 2014
README.md added const for WIN, DRAW and LOST values, update readme. Jun 23, 2017

README.md

Elo Rating PHP

A PHP class which implements the Elo rating system.

Usage

require 'src/Rating/Rating.php';

// player A elo = 1000
// player B elo = 2000
// player A lost
// player B win

$rating = new Rating(1000, 2000, Rating::LOST, Rating::WIN);

// player A elo = 1000
// player B elo = 2000
// player A draw
// player B draw

$rating = new Rating(1000, 2000, Rating::DRAW, Rating::DRAW);

$results = $rating->getNewRatings();

echo "New rating for player A: " . $results['a'];
echo "New rating for player B: " . $results['b'];

Credits

Creative Commons License
Elo Rating PHP by Michal Chovanec is licensed under a Creative Commons Attribution 4.0 International License.