propt8/country-information

PHP国家信息库

0.1 2019-09-21 17:09 UTC

This package is auto-updated.

Last update: 2024-09-22 03:49:18 UTC


README

国家信息

安装

此包可在Packagist上获取,您可以使用Composer进行安装。

composer require propt8/country-information

依赖项

  • PHP 7.1+

基本用法

use propt8\Country\Country;

Country::countryName('Lithuania'); // return CountryInformationEntity

Country::countryCode('LT'); // return CountryInformationEntity

Country::countryAlpha3Code('LTU'); // return CountryInformationEntity

Country::countryCode('LT')->toArray();
Data sample:
{
  "country_name": "Lithuania",
  "country_code": "LT",
  "country_alpha3_code": "LTU",
  "country_numeric_code": 440,
  "capital": "Vilnius",
  "country_demonym": "Lithuanians",
  "total_area": 65300,
  "population": 2876475,
  "idd_code": "370",
  "currency_code": "LTL",
  "currency_name": "Lithuanian Litas",
  "currency_symbol": "Lt",
  "lang_code": "LT",
  "lang_name": "Lithuanian",
  "cctld": "lt"
}