Download the PHP package jsgm/odds-php without Composer

On this page you can find all versions of the php package jsgm/odds-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package odds-php

Building License

OddsPHP

OddsPHP is a lightweight library to easily work with odds conversions and calculations.

With a few lines of code you'll be able to:

Installation

The recommended way to install odds-php is via Composer:

Alternatively, you can clone the repository directly:

1. Working with odds

1.1 Convert odds between formats

Convert odds between different types of formats. If the given odd is not valid it will throw an exception.

Allowed formats are:

1.2 Reduce to the lowest term a fractional odd

Reduce a fraction with the reduce() method or just pass any fraction and it will automatically reduce it for you as shown here:

Bookmarkers always use the simplest form of a fraction and you should do too.

1.3 Set decimal and percentage precision

By default, all decimal odds and percentages will be returned with 2 decimals. You can modify that by using:

2. Calculating payouts and overrounds

Now that you know how to convert odds in a few seconds, OddsPHP also includes a few tools to help you doing extra calculations easily.

The payouts are the amount of money given back to the user who won a bet whereas the overround is the profit that the bookie takes. If you don't know this concepts, check this website where you can find a bunch of examples.

Let's assume we have the following market with the given odds: Home Team Draw Away Team
4.45 3.40 1.90

This group of odds will be defined in our code like this (Rembember that you also can mix different odd formats):

The payout is calculated by simply subtracting the overround to 100. This can be done using the following method:

Getting the implied probabilities for each odd. This probabilities are not real since the bookmarker comission is added. You may need them if you want to calculate by yourself.

If we sum all of them we will have a remaining percentage, that's the overround.

We can also get the real probabilities for a group of odds:

We may get at some point a negative result for the overround. That means we have found a surebet!

3. Surebets

We can check for a surebet given a odds set. Remember that you will need at least 2 different odds bookmarkers. The next example is a real surebet case. As you might have noticed the odds are provided by different bookies.

Surebet example


All versions of odds-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jsgm/odds-php contains the following files

Loading the files please wait ...