PHP code example of shooglypeg / teams
1. Go to this page and download the library: Download shooglypeg/teams library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
shooglypeg / teams example snippets
// these three are equivalent
$name = new TeamName('Airdrieonians'); // Canonical name
$short = new TeamName('Airdrie'); // Short name
$typo = new TeamName('Airdrie United'); // Out of date might get from an external source
$name->short(); // return Airdrie
$name = TeamName::random(); // a random team
$league = TeamName::league(); // an array of all current league teams
$all = TeamName::all(); // an array of all current league teams plus any non-league teams recently in the league
$name = new TeamName(TeamName::HEART_OF_MIDLOTHIAN);
$name->slug(); // heart--of--midlothian
$name = new TeamName(TeamName::QUEENS_PARK);
$name->slug(); // queen-s--park
$name = TeamName::fromSlug('raith--rovers');