PHPackages                             stidges/country-flags - 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. stidges/country-flags

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

stidges/country-flags
=====================

A small package to convert a country code to the corresponding country flag emoji

v2.0.0(5y ago)29256.6k↓27.8%34MITPHPPHP ^7.3|^8.0

Since Jan 29Pushed 5y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (3)Used By (4)

Country Flags
=============

[](#country-flags)

[![Latest Version on Packagist](https://camo.githubusercontent.com/59cb9b152369bc3c38c0d5a4a1ac6f369894c1097f9470dc57af4050e6c39305/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737469646765732f636f756e7472792d666c616773)](https://packagist.org/packages/stidges/country-flags)[![Software License](https://camo.githubusercontent.com/b10ab13c32d27e8ef4e2d6696ea1c57daede344a04831909e9d5c6b2aab977b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737469646765732f636f756e7472792d666c6167733f636f6c6f723d627269676874677265656e)](LICENSE.md)[![Build Status](https://github.com/stidges/country-flags/workflows/Tests/badge.svg)](https://github.com/stidges/country-flags/actions)[![Total Downloads](https://camo.githubusercontent.com/eab2115c96ef5cbb17fc48085d57155f65a2dc03724353a0300547066dd663f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737469646765732f636f756e7472792d666c616773)](https://packagist.org/packages/stidges/country-flags)

A small package to convert a country code to the corresponding country flag emoji.

**Note:** Emoji flags are **not supported on Windows**, which displays two-letter country codes instead of emoji flag images.

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

[](#installation)

You can install the package via Composer:

```
$ composer require stidges/country-flags
```

Basic Usage
-----------

[](#basic-usage)

```
$countryFlag = new CountryFlag;

echo $countryFlag->get('NL'); // "🇳🇱"
```

Aliasing
--------

[](#aliasing)

If you would like to make country codes available under a custom aliases, you can pass these to the constructor:

```
$countryFlag = new CountryFlag([
    'AA' => 'NL',
]);

echo $countryFlag->get('AA'); // "🇳🇱"
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stidges](https://github.com/stidges)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~1075 days

Total

2

Last Release

1956d ago

Major Versions

v1.0.0 → v2.0.02021-01-08

PHP version history (2 changes)v1.0.0PHP ~5.6|~7.0

v2.0.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d3026e6eab9c0c75c7315cd4b8ea41d1ab9e0b7665a1f9f9396e2f1f716deba?d=identicon)[stidges](/maintainers/stidges)

---

Top Contributors

[![stidges](https://avatars.githubusercontent.com/u/4399967?v=4)](https://github.com/stidges "stidges (8 commits)")[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (1 commits)")

---

Tags

countriesemojiflagsunicodecountriesflagcountryemojicountry flags

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  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)[stidges/laravel-country-flags

A Laravel wrapper for the stidges/country-flags package

28134.6k](/packages/stidges-laravel-country-flags)[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)[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[lipis/flag-icons

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

12.0k27.5k4](/packages/lipis-flag-icons)[joypixels/emoji-toolkit

JoyPixels is a complete set of emoji designed for the web. The emoji-toolkit includes libraries to easily convert unicode characters to shortnames (:smile:) and shortnames to JoyPixels emoji images. PNG formats provided for the emoji images.

465817.1k7](/packages/joypixels-emoji-toolkit)

PHPackages © 2026

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