mobbi-dev/minicountryflag
最新稳定版本:v1.0.0
Composer 安装命令:
composer require mobbi-dev/minicountryflag
包简介
Small PHP class to get country flags as emojis based on country codes (ISO 3166-1 alpha-2).
README 文档
README
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
- Converts valid 2-letter country codes (e.g.
FI,US,JP) to flag emojis (🇫🇮 🇺🇸 🇯🇵) - Validates input (throws exception on invalid codes)
- Lightweight
📦 Installation
Using Composer:
composer require mobbi-dev/minicountryflag
🔧 Usage
use MiniCountryFlag\MiniCountryFlag; $flag = new MiniCountryFlag('fi'); echo $flag->getEmoji(); // 🇫🇮 echo $flag->getName(); // Finland echo $flag->getFlagImageUrl(); // https://flagcdn.com/24x18/fi.png
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-04