定制 donsi/iso3166 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

donsi/iso3166

Composer 安装命令:

composer require donsi/iso3166

包简介

ISO 3166-1 PHP Library with multiple languages

README 文档

README

Fork of thephpleague/iso3166 PHP library providing ISO 3166-1 country data with support of multiple languages.

Currently supported languages: English, German, France, Russian, Arabic

Installing

$ composer require donsi/iso3166

Using

Quick guide with custom language:

$ISO3166 = new Donsi\ISO3166\ISO3166;
$ISO3166->setLanguage('de');
$data = $ISO3166->alpha3('nld');

Data sample:

[
    'name' => 'Niederlande',
    'alpha2' => 'NL',
    'alpha3' => 'NLD',
    'numeric' => '528'
]

All available languages:

// en, de, fr, ru, ar, ...
$languages = (new Donsi\ISO3166\ISO3166)->getLanguages();

You still can use all methods with default language:

$data = (new Donsi\ISO3166\ISO3166)->name($name);
$data = (new Donsi\ISO3166\ISO3166)->alpha2($alpha2);
$data = (new Donsi\ISO3166\ISO3166)->alpha3($alpha3);
$data = (new Donsi\ISO3166\ISO3166)->numeric($numeric);

The currency (part of the origin library) is currently not available.

See also iso3166.thephpleague.com/using section of the origin documentation.

Data

The country data is based on Wikipedia, gathered and shaped from stefangabos/world_countries.

What is ISO 3166-1

ISO 3166-1 is part of the ISO 3166 standard published by the International Organization for Standardization (ISO), and defines codes for the names of countries, dependent territories, and special areas of geographical interest. The official name of the standard is Codes for the representation of names of countries and their subdivisions – Part 1: Country codes. It defines three sets of country codes:

  • ISO 3166-1 alpha-2 – two-letter country codes which are the most widely used of the three, and used most prominently for the Internet's country code top-level domains (with a few exceptions).
  • ISO 3166-1 alpha-3 – three-letter country codes which allow a better visual association between the codes and the country names than the alpha-2 codes.
  • ISO 3166-1 numeric – three-digit country codes which are identical to those developed and maintained by the United Nations Statistics Division, with the advantage of script (writing system) independence, and hence useful for people or systems using non-Latin scripts.

-- Wikipedia

Contributing

Feel free to submit a pull request or create an issue.

License

donsi/iso3166 is licensed under the MIT license.

Source(s)

统计信息

  • 总下载量: 183
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 68
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固