addressing - A PHP 5.4+ addressing library, powered by Google's dataset.

  •        401

The [address object](https://github.com/commerceguys/addressing/blob/master/src/Model/AddressInterface.php) represents a postal adddress, and has the following fields:- Country- Administrative area- Locality (City)- Dependent Locality- Postal code- Sorting code- Address line 1- Address line 2- Organization- RecipientField names follow the OASIS [eXtensible Address Language (xAL)](http://www.oasis-open.org/committees/ciq/download.shtml) standard.The [address format object](https://github.com/commerceguys/addressing/blob/master/src/Model/AddressFormatInterface.php) contains the following data for a country:- Which fields are used, and in which order- Which fields are required- Which fields need to be uppercased for the actual mailing (to facilitate automated sorting of mail)- The labels for the administrative area (state, province, parish, etc.), locality (city/post town/district, etc.), dependent locality (neighborhood, suburb, district, etc) and the postal code (postal code or ZIP code)- The regular expression pattern for validating postal codesThe [subdivision object](https://github.com/commerceguys/addressing/blob/master/src/Model/SubdivisionInterface.php) contains the following data:- The subdivision code (used to represent the subdivison on a parcel/envelope, e.g. CA for California)- The subdivison name (shown to the user in a dropdown)- The postal code prefix (used to ensure that a postal code begins with the expected characters)Subdivisions are hierarchical and can have up to three levels:Administrative Area -> Locality -> Dependent Locality.```phpuse CommerceGuys\Addressing\Repository\AddressFormatRepository;use CommerceGuys\Addressing\Repository\SubdivisionRepository;$addressFormatRepository = new AddressFormatRepository();$subdivisionRepository = new SubdivisionRepository();// Get the address format for Brazil.$addressFormat = $addressFormatRepository->get('BR');// Get the subdivisions for Brazil.$states = $subdivisionRepository->getAll('BR');foreach ($states as $state) { $municipalities = $state->getChildren();}// Get the subdivisions for Canada, in French.$states = $subdivisionRepository->getAll('CA', 0, 'fr');foreach ($states as $state) { echo $state->getName();}```

https://github.com/commerceguys/addressing

Tags
Implementation
License
Platform

   




Related Projects

vim-olive - Vim Mode Line Verifier


Vim Mode Line Verifier

vim-mash - Motion Activated Search Highlighter for Vim


Motion Activated Search Highlighter for Vim

vim-grillz - Flash your wicked grillz!


Flash your wicked grillz!

vim-foist - Complete whole lines from any partial therein


Complete whole lines from any partial therein

vim-efmc - Vim Error Format Compiler


Vim Error Format Compiler


uzbl-utrs - mkng uzbl tlrbl


mkng uzbl tlrbl

toycsv - A toy CSV parser written in ruby + lexr + racc


A toy CSV parser written in ruby + lexr + racc

tiktok - TikTok provides a simple asynchronous timer object for VimL.


TikTok provides a simple asynchronous timer object for VimL.

tabby - Using Vim's Tabs the Right Way


Using Vim's Tabs the Right Way

SohiVila - GNU source-highlight Vim language


GNU source-highlight Vim language

SinTax - A DSL for generating Vim syntax highlighting files


A DSL for generating Vim syntax highlighting files

rkdots - Generate a graphviz visualisation of the given javascript statement.


Generate a graphviz visualisation of the given javascript statement.

RelNumBar - Show relativenumbers alongside normal numbers in Vim


Show relativenumbers alongside normal numbers in Vim

Punisher - Punisher hurts you where it hurts most - your time.


Punisher hurts you where it hurts most - your time.

noisy - Don't chat quietly (weechat channel noises)


Don't chat quietly (weechat channel noises)

newlisp-manual - Asciidoc version of the newLISP manual


Asciidoc version of the newLISP manual

Land-of-newLISP - Selected snippets from Land of Lisp rewritten in newLISP


Selected snippets from Land of Lisp rewritten in newLISP

Fossilise - Poor man's collaborative editing in Vim


Poor man's collaborative editing in Vim

firstly - Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers


Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers