PHP code example of hypejunction / hypecountries

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


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

$countries = elgg()->countries->getCountries();
foreach ($countries as $country) {
	/* @var $country \hypeJunction\Country */
	echo "$country->name ($country->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');