Skip to content

Lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric

Notifications You must be signed in to change notification settings

boring-dragon/iso-3166

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iso-3166

Build Status StyleCI

Library to lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric

Installation

composer require jinas/iso-3166

Usage

Get country by ISO 3166-1 Alpha-2

use Jinas\ISO\ISO3166;

$iso = new ISO3166;
var_dump($iso->whereAlpha2('no'));

/* Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/

Get country by ISO 3166-1 Alpha-3

use Jinas\ISO\ISO3166;

$iso = new ISO3166;
var_dump($iso->whereAlpha3('nor'));
/* Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/

Get country by ISO 3166-1 Numeric

use Jinas\ISO\ISO3166;

$iso = new ISO3166;
var_dump($iso->whereNumeric(578));
/* Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/

Get values by country name

use Jinas\ISO\ISO3166;

$iso = new ISO3166;
var_dump($iso->whereCountry("norway"));

/* Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/

License

MIT © Mohamed Jinas

About

Lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages