PHP code example of georgringer / country-backport

1. Go to this page and download the library: Download georgringer/country-backport 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/ */

    

georgringer / country-backport example snippets


$countryProvider = GeneralUtility::makeInstance(\GeorgRinger\CountryBackport\Country\CountryProvider);
$france = $countryProvider->getByIsoCode('FR');
// or
$france = $countryProvider->getByName('France');
// or
$france = $countryProvider->getByAlpha3IsoCode('FRA');
// or
$filter = new \GeorgRinger\CountryBackport\Country\CountryFilter();
$filter->setExcludeCountries(['DE', 'AT']);
$filter->setOnlyCountries(['FR', 'IT', 'AT']);
$list = $countryProvider->getFiltered($filter);