Download the PHP package happyphper/country without Composer
On this page you can find all versions of the php package happyphper/country. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download happyphper/country
More information about happyphper/country
Files in happyphper/country
Download happyphper/country
More information about happyphper/country
Files in happyphper/country
Vendor happyphper
Package country
Short Description A PHP package containing information about all countries including ISO codes, names, and flags
License MIT
Package country
Short Description A PHP package containing information about all countries including ISO codes, names, and flags
License MIT
Please rate this library. Is it a good library?
Informations about the package country
Country PHP Package
这是一个简单的 PHP 包,提供了所有国家的信息,包括 ISO 代码、名称和国旗。
数据来源
本包使用的国家数据来自 ISO 3166-1 标准,包括:
- ISO 3166-1 alpha-2 代码(如:CN)
- ISO 3166-1 alpha-3 代码(如:CHN)
- ISO 3166-1 numeric 代码(如:156)
- 国家英文名称
安装
使用 Composer 安装:
使用方法
获取所有国家
通过 ISO 代码获取国家
获取国家信息
获取国旗 URL
包支持多种方式获取国旗 URL:
1. 获取默认尺寸的国旗(320px 宽度)
2. 获取固定宽度的国旗
3. 获取固定高度的国旗
4. 获取固定尺寸的国旗
5. 获取不同格式的国旗
6. 获取 SVG 格式的国旗
多语言支持
本包支持多语言(国际化),可通过设置 locale 获取不同语言的国家名称。 目前已内置支持:英文(en)、简体中文(zh-CN)、繁体中文(zh-TW)。
示例
如需自定义语言,可在 resources/lang/ 目录下添加对应的语言文件。
国旗来源
国旗图片来自 flagcdn.com,这是一个免费的国旗 CDN 服务。
许可证
MIT License
All versions of country with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
The package happyphper/country contains the following files
Loading the files please wait ...