PHPackages                             hrvthzslt/php-country-list - 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. hrvthzslt/php-country-list

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

hrvthzslt/php-country-list
==========================

Listing country alpha2, alpha3, numeric and isd codes

v1.0.0(7y ago)0563MITPHPPHP ^5.5 || ^7.0

Since Apr 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/szmass/php-country-list)[ Packagist](https://packagist.org/packages/hrvthzslt/php-country-list)[ RSS](/packages/hrvthzslt-php-country-list/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

PhpCountryList
==============

[](#phpcountrylist)

Listing country alpha2, alpha3, numeric and isd codes with continent names and codes

Usage
-----

[](#usage)

### Listing

[](#listing)

Collect all countries

```
$phpCountryList = new \HrvthZslt\PhpCountryList\PhpCountryList();
$countries = $phpCountryList->getAllCountries();
```

$countries content:

```
  ...
  156 => HrvthZslt\PhpCountryList\Models\Country {#1340
    +name: "Netherlands"
    +alpha2: "NL"
    +alpha3: "NLD"
    +numeric: "528"
    +isd: 31
    +continent: HrvthZslt\PhpCountryList\Models\Continent {#1341
      +name: "Europe"
      +code: "EU"
    }
  }
  157 => HrvthZslt\PhpCountryList\Models\Country {#1342
    +name: "New Caledonia"
    +alpha2: "NC"
    +alpha3: "NCL"
    +numeric: "540"
    +isd: 687
    +continent: HrvthZslt\PhpCountryList\Models\Continent {#1343
      +name: "Oceania"
      +code: "OC"
    }
  }
  ...

```

Collect countries for continent

```
$phpCountryList = new \HrvthZslt\PhpCountryList\PhpCountryList();
$countries = $phpCountryList->getAllCountriesForContinent('NA');
```

### Search

[](#search)

Search for country by alpha2, alpha3, numeric code or isd code

```
$country = $phpCountryList->getCountryByAlpha2('HM');
$country = $phpCountryList->getCountryByAlpha3('HMD');
$country = $phpCountryList->getCountryByNumericCode('334');
$country = $phpCountryList->getCountryByIsd(672);
```

These searches yields

```
HrvthZslt\PhpCountryList\Models\Country {#906
  +name: "Heard Island and Mcdonald Islands"
  +alpha2: "HM"
  +alpha3: "HMD"
  +numeric: "334"
  +isd: 672
  +continent: HrvthZslt\PhpCountryList\Models\Continent {#907
    +name: "Antarctica"
    +code: "AN"
  }
}

```

### Country instance

[](#country-instance)

Check country continent, returns true or false

```
/** @var HrvthZslt\PhpCountryList\Models\Country $country */
$result = $country->inContinent('EU');
```

Convert to array

```
/** @var HrvthZslt\PhpCountryList\Models\Country $country */
$contryArray = $country->toArray();
```

$countryArray value

```
array:6 [
  "name" => "Antarctica"
  "alpha2" => "AQ"
  "alpha3" => "ATA"
  "numeric" => "010"
  "isd" => 672
  "continent" => array:2 [
    "name" => "Antarctica"
    "code" => "AN"
  ]
]

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2576d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/54ac068b962774967f06f9a626fa655b48994ba7dc3b11da116b634cb7d3b930?d=identicon)[szmass](/maintainers/szmass)

---

Top Contributors

[![hrvthzslt](https://avatars.githubusercontent.com/u/17411717?v=4)](https://github.com/hrvthzslt "hrvthzslt (1 commits)")

### Embed Badge

![Health badge](/badges/hrvthzslt-php-country-list/health.svg)

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

###  Alternatives

[jeroen/rewindable-generator

Provides a simple adapter to make generators rewindable

1655.4k2](/packages/jeroen-rewindable-generator)

PHPackages © 2026

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