PHP code example of thalidzhokov / country-codes

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

    

thalidzhokov / country-codes example snippets




\CountryCodes::$language = 'ru';

\CountryCodes::get('alpha2', 'country');

\CountryCodes::get2('alpha3', ['alpha2', 'continentCode', 'emoji']);

\CountryCodes::getByContinent('alpha3', 'countryFull', 'EU');

\CountryCodes::getEmojiByAlpha2('ZW');

\CountryCodes::getEmojiByAlpha3('ZMB');

array (
  'ABH' => 
  array (
    'alpha2' => 'AB',
    'continentCode' => 'AS',
    'emoji' => '',
  ),
  'AND' => 
  array (
    'alpha2' => 'AD',
    'continentCode' => 'EU',
    'emoji' => '&#x1F1E6;&#x1F1E9;',
  ),
  'ARE' => 
  array (
    'alpha2' => 'AE',
    'continentCode' => 'AS',
    'emoji' => '&#x1F1E6;&#x1F1EA;',
  ),
  ...
)