项目作者: trickeyone

项目描述 :
IntlSubdivision Component - Retrieve State/Province Information
高级语言: PHP
项目地址: git://github.com/trickeyone/intl-subdivision.git
创建时间: 2016-11-08T03:13:39Z
项目社区:https://github.com/trickeyone/intl-subdivision

开源协议:

下载


IntlSubdivision Component

PHPUnit
code coverage badge
Test Coverage
Code Climate

A companion component to Symfony’s Intl Component. This component allows for easy retrieval of a country’s states/provinces
using the country’s ISO 3166-1 alpha-2 code.

The Symfony Intl component is a replacement for the C intl extension. It is limited to only the “en” locale. If you want
to have access to more locales you should install the intl PECL extension.

Usage:

  1. // States/Provinces for the United States of America
  2. $subdivisionsForUS = \Symfony\Component\IntlSubdivision\IntlSubdivision::getStatesAndProvincesForCountry('US');
  3. // States/Provinces for Canada
  4. $subdivisionsForCA = \Symfony\Component\IntlSubdivision\IntlSubdivision::getStatesAndProvincesForCountry('CA');
  5. // States/Provinces for the United Arab Emirates
  6. $subdivisionsForAE = \Symfony\Component\IntlSubdivision\IntlSubdivision::getStatesAndProvincesForCountry('AE');

Requirements

  • PHP 7+ or 8+
  • Symfony Intl package 5.0+ or 6.0+
    • older versions can still support 4.0+ but are not actively supported

Resources