PHP code example of rocketfellows / iso-standard-3166-factory

1. Go to this page and download the library: Download rocketfellows/iso-standard-3166-factory 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/ */

    

rocketfellows / iso-standard-3166-factory example snippets


composer 

$factory = new CountryFactory();

$factory->createByCode('AT');   // creates by alpha2 code
$factory->createByCode('at');   // creates by alpha2 code in lower case
$factory->createByCode('AUT');  // creates by alpha3
$factory->createByCode('aut');  // creates by alpha3 in lower case
$factory->createByCode('040');  // creates by numeric code

$factory = new CountryFactory();

$factory->createByName('Austria');