PHP code example of arcreative / php-address-format

1. Go to this page and download the library: Download arcreative/php-address-format library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arcreative / php-address-format example snippets


$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'
));

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