PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Jelle Sebreghts   PHP TheSportsDb   README.md   Download  
File: README.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP TheSportsDb
Get game information from the Sports DB site API
Author: By
Last change: Update README.md
Update README.md
Date: 7 years ago
Size: 1,899 bytes
 

Contents

Class file image Download

TheSportsDb

PHP Library to connect to the api of http://thesportsdb.com/

Example code

<?php

include_once __DIR__ . '/default_bootstrap.php';

// Get all sports.
$sports = $db->getSports();

// Print the first sport.
$sport = reset($sports);
print_r($sport->raw());

// Get the leagues of this sport (lazy loaded).
$leagues = $sport->getLeagues();

// Print the first league.
$league = reset($leagues);
print_r($league->raw());

// Get the seasons for this league.
$seasons = $league->getSeasons();

// Print the first season.
$season = reset($seasons);
print_r($season->raw());

// Get the events for this league.
$events = $season->getEvents();

// Print the first event.
$event = reset($events);
// Trigger lazy load, the full event object will be loaded when calling $event->raw().
$event->getName();
print_r($event->raw());

Code Climate Scrutinizer Code Quality Codacy Badge SensioLabsInsight Build Status

Code Coverage