14 lines
405 B
PHP
14 lines
405 B
PHP
<?php
|
|
function get_odds($sport = 'soccer_epl', $regions = 'uk', $markets = 'h2h') {
|
|
$apiKey = '308deae256c9099c52e22bb4933a12b6';
|
|
$url = "https://api.the-odds-api.com/v4/sports/{$sport}/odds/?regions={$regions}&markets={$markets}&apiKey={$apiKey}";
|
|
|
|
$response = @file_get_contents($url);
|
|
|
|
if ($response === FALSE) {
|
|
return null;
|
|
}
|
|
|
|
return json_decode($response, true);
|
|
}
|
|
?>
|