PHPackages                             megastruktur/phone-country-codes - 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. megastruktur/phone-country-codes

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

megastruktur/phone-country-codes
================================

A simple library to get phone country codes.

0.4(8y ago)8214.2k↓42.1%42MITPHPPHP &gt;=5.3.0

Since Oct 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/megastruktur/phone-country-codes)[ Packagist](https://packagist.org/packages/megastruktur/phone-country-codes)[ Docs](http://github.com/megastruktur/phone-country-codes)[ RSS](/packages/megastruktur-phone-country-codes/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (5)Used By (2)

Phone Country Codes
===================

[](#phone-country-codes)

The library provides a list of country phone codes.

### Example

[](#example)

`getCodesList` method:

```
   "AF" => "+93",
   "AX" => "+358",
   "AL" => "+355",
   "DZ" => "+213",
   "AS" => "+1684",

```

`getCodesFullList` method allows to get the list of all details per phone/country code.

### Usage

[](#usage)

```
// Return the list of phone codes:
\megastruktur\PhoneCountryCodes::getCodesList();

/* Return the full array of codes and details:
 *  "country_code" => [
 *    "name",
 *    "dial_code",
 *    "code",
 *  ]
*/
\megastruktur\PhoneCountryCodes::getCodesFullList();
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

3185d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2911416?v=4)[Piotr Varaksin](/maintainers/megastruktur)[@megastruktur](https://github.com/megastruktur)

---

Tags

phonecountry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/megastruktur-phone-country-codes/health.svg)

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

###  Alternatives

[components/flag-icon-css

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

12.2k1.7M22](/packages/components-flag-icon-css)[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.7k8.0M62](/packages/rinvex-countries)[lipis/flag-icons

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

12.2k43.4k10](/packages/lipis-flag-icons)[brick/phonenumber

Phone number library

4327.8M63](/packages/brick-phonenumber)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1731.9M](/packages/dougsisk-laravel-country-state)[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

140876.5k3](/packages/alexandernst-yii2-device-detect)

PHPackages © 2026

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