2017 © Pedro Peláez
 

library php-address-format

Simple address formatting for the masses

image

arcreative/php-address-format

Simple address formatting for the masses

  • Monday, June 23, 2014
  • by arcreative
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4,929 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

php-address-format

Simple address formatting for the masses, (*1)

Usage

$af = new AddressFormat();
$formattedAddress = $af->format(array(
    'address' => '1234 Some St.',
    'address2' => 'Floor #67',
    'address3' => 'Unit #123',
    'city' => 'San Francisco',
    'subdivision' => 'CA',
    'postalCode' => '94105',
    'countryCode' => 'US'
));

will output, (*2)

array(
  '1234 Some St.',
  'Floor #67',
  'Unit #123',
  'San Francisco, CA 94105'
)

If a line does not have any information, it will be omitted., (*3)

No fields are required to call the formatter, but the only property that will invoke some logic is the ISO 3166 Alpha-2 country code, for which an index can be found here., (*4)

Contributions

Gladly accepting contributions, hopefully in the form of additional countries. Regardless of current tests being a bit naive, please include tests for added countries to ensure the output is as expected., (*5)

Other implementations

The Versions

23/06 2014

dev-master

9999999-dev

Simple address formatting for the masses

  Sources   Download

MIT

by Adam Robertson

23/06 2014

0.0.2

0.0.2.0

Simple address formatting for the masses

  Sources   Download

MIT

by Adam Robertson

21/06 2014

0.0.1

0.0.1.0

Simple address formatting for the masses

  Sources   Download

MIT

by Adam Robertson