Skip to content

unitedworldwrestling/countrycio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Country list

Country list with ISO3166 (alpha-2 and 3) and IOC codes

Countrie.json file creation:

  1. git clone https://github.com/mledoze/countries
  2. composer install
  3. php countries.php convert -f json -i name -i cca2 -i cca3 -i cioc -i region
  4. the converted file is located at dist/countries.json

Usage

Composer:

 require unitedworldwrestling/countrycio dev-master

PHP class:

use Unitedworldwrestling\Countrycio\CountrycioDB;

...

    $countrycioDB = new CountrycioDB();
/*
    $countrycioDB->search($needle, $searchType='cca2', $returnKeys = [])
    $searchType any of 'name','cca2','cca3','cioc','region'
    $returnKeys an array of searchType values to be included in the response

    The search function returns with an array of countries matching to the given searchType and includes fields specified in returnKeys (or all fields, if the parameter is empty)
*/

    $ciocCodes = $countrycioDB->search('CH','cca2','cioc');
    $target  = empty($ciocCodes) ? '' : $ciocCodes[0]['cioc'] ?? '';

About

List of countries and their ISO3166 and IOC codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages