Betting odds in PHP

Discussion in 'PHP' started by Pandy90, Sep 13, 2010.

  1. #1
    I was just wondering how to code betting odds (such as 10/1, 7/5, 11/10, etc.) into php. I want to make a betting page on my website but not too sure how to code the betting odds that gives the users their winning based on the odds they betted on.

    Thanks in advance
     
    Pandy90, Sep 13, 2010 IP
  2. idcatalin

    idcatalin Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    10/1 is 11 in decimal so you have an decimal odds , you also need to ask how much money a visitor want to bet and rest is mathematics.
     
    idcatalin, Mar 9, 2011 IP
  3. SedNaX

    SedNaX Active Member

    Messages:
    1,326
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Given a know odd ratio x:1. User bets $z. Note than w:y can be written as x:1, by setting x=w/y (So 7:5 is the same as (7/5):1 )

    User loses: user loses z
    User wins: user wins z*x

    This is just some basic math, did you have a specific question?
     
    SedNaX, Mar 9, 2011 IP