ankalagon / vies-address-formatter
Library to format data from VIES service (http://ec.europa.eu/taxation_customs/vies/?locale=en)
Installs: 25 808
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2024-11-20 00:48:30 UTC
README
Service can recognize postal_code
, city
and address
(rest of address line) from address provided by VIES service (http://ec.europa.eu/taxation_customs/vies/?locale=en).
Requirements
- PHP5.3 and above
or
- PHP7.0 and above
Installation
Update your composer.json and run composer update
{ "require": { "ankalagon/vies-address-formatter": "^1.0" } }
or execute
composer require ankalagon/vies-address-formatter
Usage
use Ankalagon\ViesAddressFormatter\ViesFormatter; $result = ViesFormatter::recognize("GB", "254 BANNERDALE ROAD<br>SHEFFIELD<br>S11 9FE"); print_r($result);
the above example will produce the following output:
Array ( [city] => Sheffield [postal_code] => S11 9FE [address] => 254 Bannerdale Road )
Example address line recognizion
Thanks to
Special thanks to Matthew Bednarski for postal-code.json
library (https://gist.github.com/matthewbednarski/4d15c7f50258b82e2d7e). I use it (with small modfications) in this project.