PHPackages                             mobbi-dev/minicountryflag - 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. mobbi-dev/minicountryflag

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

mobbi-dev/minicountryflag
=========================

Small PHP class to get country flags as emojis based on country codes (ISO 3166-1 alpha-2).

v1.0.0(10mo ago)01MITPHPPHP &gt;=7.4

Since Jul 4Pushed 10mo agoCompare

[ Source](https://github.com/mobbi-dev/MiniCountryFlag)[ Packagist](https://packagist.org/packages/mobbi-dev/minicountryflag)[ RSS](/packages/mobbi-dev-minicountryflag/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MiniCountryFlag
===============

[](#minicountryflag)

MiniCountryFlag is a tiny PHP class that converts ISO 3166-1 alpha-2 country codes (like `FI`, `US`, `JP`) into flag emojis (🇫🇮 🇺🇸 🇯🇵).

Perfect for small projects, websites, or any application that needs to display country flags from ISO codes in a lightweight way.

---

🚀 Features
----------

[](#-features)

- Converts valid 2-letter country codes (e.g. `FI`, `US`, `JP`) to flag emojis (🇫🇮 🇺🇸 🇯🇵)
- Validates input (throws exception on invalid codes)
- Lightweight

---

📦 Installation
--------------

[](#-installation)

**Using Composer:**

```
composer require mobbi-dev/minicountryflag
```

---

🔧 Usage
-------

[](#-usage)

```
use MiniCountryFlag\MiniCountryFlag;

$flag = new MiniCountryFlag('fi');

echo $flag->getEmoji(); // 🇫🇮
echo $flag->getName(); // Finland
echo $flag->getFlagImageUrl(); // https://flagcdn.com/24x18/fi.png
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance54

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

310d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d8ea4f186a87f068f938c58d9c044d5059c47f15fc2a49cdc0678d1fe578f27?d=identicon)[mobbi](/maintainers/mobbi)

---

Top Contributors

[![mobbi-dev](https://avatars.githubusercontent.com/u/62039300?v=4)](https://github.com/mobbi-dev "mobbi-dev (5 commits)")

---

Tags

phpcountriesflagcountryemojiIso3166

### Embed Badge

![Health badge](/badges/mobbi-dev-minicountryflag/health.svg)

```
[![Health](https://phpackages.com/badges/mobbi-dev-minicountryflag/health.svg)](https://phpackages.com/packages/mobbi-dev-minicountryflag)
```

###  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)[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[stidges/country-flags

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

29256.6k4](/packages/stidges-country-flags)[stidges/laravel-country-flags

A Laravel wrapper for the stidges/country-flags package

28134.6k](/packages/stidges-laravel-country-flags)[sun/country

Sun Country is the package that helps you to get the country name &amp; dialing code by the country ISO 3166-1 Alpha-2 code.

1016.5k](/packages/sun-country)

PHPackages © 2026

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