PHP code example of hypejunction / countries

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

    

hypejunction / countries example snippets


echo elgg_view('input/country', array(
	'name' => 'country',
	'value' => 'CZ',
));

$countries = elgg_get_countries();
foreach ($countries as $iso => $name) {
	echo "$name ($iso)";
}

$fields = array(
	'name',
	'iso',
	'iso3',
	//'iso_numeric',
	//'fips',
	'capital',
	//'area',
	//'population',
	//'continent',
	'tld',
	'currency_code',
	'currency_name',
	'phone_code',
	'postal_code_format',
	'postal_code_regex',
	'languages',
	//'geoname_id',
	'neighbours'
);

// Get a list of countries ordered by currency_code
$countries = elgg_get_country_info($fields, 'currency_code');