PHPackages                             phine/country - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phine/country

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

phine/country
=============

A PHP library for country and subdivision data.

1.1.0(11y ago)52364.9k↑17%8[1 issues](https://github.com/kherge-archive/lib-country/issues)[1 PRs](https://github.com/kherge-archive/lib-country/pulls)2MITPHPPHP &gt;=5.3.3

Since Nov 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kherge-archive/lib-country)[ Packagist](https://packagist.org/packages/phine/country)[ Docs](https://github.com/phine/lib-country)[ RSS](/packages/phine-country/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (2)

Country
=======

[](#country)

[![Build Status](https://camo.githubusercontent.com/48ee71600fd74c9f72edb00d88fe67bfca901565a6495a439d6a391dda5239b5/68747470733a2f2f7472617669732d63692e6f72672f7068696e652f6c69622d636f756e7472792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/phine/lib-country)[![Coverage Status](https://camo.githubusercontent.com/3bbac1931dac28c965b89f3376bda5359e22366daff76733b17bb685f52f3beb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7068696e652f6c69622d636f756e7472792f62616467652e706e67)](https://coveralls.io/r/phine/lib-country)[![Latest Stable Version](https://camo.githubusercontent.com/2d4a14afe42374105ab37d2f24963097dbd48dba2836d2acc5fb632bf4f3317f/68747470733a2f2f706f7365722e707567782e6f72672f7068696e652f636f756e7472792f762f737461626c652e706e67)](https://packagist.org/packages/phine/country)[![Total Downloads](https://camo.githubusercontent.com/d09c83ed01dbcff489f969035118fc1ca1436fe9ff9198f31fb99bccc107837e/68747470733a2f2f706f7365722e707567782e6f72672f7068696e652f636f756e7472792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/phine/country)

A PHP library for country and subdivision data.

Usage
-----

[](#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
-----------

[](#requirement)

- PHP &gt;= 5.3.3
- [Phine Exception](https://github.com/phine/lib-exception) &gt;= 1.0

Installation
------------

[](#installation)

Via [Composer](http://getcomposer.org/):

```
$ composer require "phine/country=~1.0"

```

Documentation
-------------

[](#documentation)

You can find the documentation in the [`docs/`](docs/) directory.

License
-------

[](#license)

This library is available under the [MIT license](LICENSE).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~535 days

Total

2

Last Release

4046d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

[![kherge](https://avatars.githubusercontent.com/u/9122157?v=4)](https://github.com/kherge "kherge (18 commits)")

---

Tags

countriescountry

### Embed Badge

![Health badge](/badges/phine-country/health.svg)

```
[![Health](https://phpackages.com/badges/phine-country/health.svg)](https://phpackages.com/packages/phine-country)
```

###  Alternatives

[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.4M48](/packages/rinvex-countries)[components/flag-icon-css

A curated collection of all country flags in SVG — plus the CSS for easier integration.

12.0k1.6M23](/packages/components-flag-icon-css)[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[webpatser/laravel-countries

Modern Laravel Countries package providing ISO 3166-2, ISO 3166-3, currency, capital and more for all countries. Compatible with Laravel 11.x and 12.x.

8272.8M8](/packages/webpatser-laravel-countries)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
