Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.
/ lib-country Public archive

A PHP library for country and subdivision data.

License

Notifications You must be signed in to change notification settings

kherge-archive/lib-country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

17278e9 · Apr 21, 2015

History

18 Commits
Apr 21, 2015
Nov 1, 2013
Nov 1, 2013
Nov 1, 2013
Nov 8, 2013
Dec 11, 2013
Nov 1, 2013
Nov 1, 2013
Jan 8, 2014
Nov 1, 2013
Nov 1, 2013
Nov 1, 2013
Nov 1, 2013

Repository files navigation

Country

Build Status Coverage Status Latest Stable Version Total Downloads

A PHP library for country and subdivision data.

Usage

use Phine\Country\Loader\Loader;

$loader = new Loader();

// returns data for "US"
$country = $loader->loadCountry('US');

echo $country->getAlpha2Code(); // "US"
echo $country->getAlpha3Code(); // "USA"
echo $country->getLongName(); // "United States of America"
echo $country->getNumericCode(); // "840"
echo $country->getShortName(); // "United States"

// returns all countries
$countries = $loader->loadCountries();

$country = $countries['US'];

// returns data for "US-CA"
$subdivision = $loader->loadSubdivision('US-CA');

echo $subdivision->getCode(); // "US-CA"
echo $subdivision->getName(); // "California"

// returns all subdivisions
$subdivisions = $loader->loadSubdivisions();

$subdivision = $subdivisions['US-CA'];

// returns all subdivisions for a specific country
$subdivisions = $loader->loadSubdivisions('US');

Requirement

Installation

Via Composer:

$ composer require "phine/country=~1.0"

Documentation

You can find the documentation in the docs/ directory.

License

This library is available under the MIT license.

About

A PHP library for country and subdivision data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages