1. Go to this page and download the library: Download jabarihunt/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/ */
jabarihunt / country-codes example snippets
use jabarihunt/CountryCodes;
public const CountryCodes::CODE_TYPE_COUNTRY_NAME
public const CountryCodes::CODE_TYPE_NATIVE_NAME
public const CountryCodes::CODE_TYPE_2_LETTER
public const CountryCodes::CODE_TYPE_3_LETTER
public const CountryCodes::CODE_TYPE_UN
// RETURN HARD CODED CLASS VALUES
$allCountryCodes = CountryCodes::getAll();
/* OR */
// RETURN DATA VIA HTTP REQUEST TO THE REST COUNTRIES API
$allCountryCodes = CountryCodes::getAll(TRUE);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.