-
-
Save sumanthkumarc/3204c761eaa1646f3a4fd6cb1cf99e7c to your computer and use it in GitHub Desktop.
<?php | |
function get_eu_countries() { | |
$countries = []; | |
$countries['AT'] = ['name' => 'Austria',]; | |
$countries['BE'] = ['name' => 'Belgium',]; | |
$countries['BG'] = ['name' => 'Bulgaria',]; | |
$countries['CY'] = ['name' => 'Cyprus',]; | |
$countries['CZ'] = ['name' => 'Czech Republic',]; | |
$countries['DE'] = ['name' => 'Germany',]; | |
$countries['DK'] = ['name' => 'Denmark',]; | |
$countries['EE'] = ['name' => 'Estonia',]; | |
$countries['ES'] = ['name' => 'Spain',]; | |
$countries['FI'] = ['name' => 'Finland',]; | |
$countries['FR'] = ['name' => 'France',]; | |
$countries['GB'] = ['name' => 'United Kingdom',]; | |
$countries['GR'] = ['name' => 'Greece',]; | |
$countries['HU'] = ['name' => 'Hungary',]; | |
$countries['HR'] = ['name' => 'Croatia',]; | |
$countries['IE'] = ['name' => 'Ireland, Republic of (EIRE)',]; | |
$countries['IT'] = ['name' => 'Italy',]; | |
$countries['LT'] = ['name' => 'Lithuania',]; | |
$countries['LU'] = ['name' => 'Luxembourg',]; | |
$countries['LV'] = ['name' => 'Latvia',]; | |
$countries['MT'] = ['name' => 'Malta',]; | |
$countries['NL'] = ['name' => 'Netherlands',]; | |
$countries['PL'] = ['name' => 'Poland',]; | |
$countries['PT'] = ['name' => 'Portugal',]; | |
$countries['RO'] = ['name' => 'Romania',]; | |
$countries['SE'] = ['name' => 'Sweden',]; | |
$countries['SI'] = ['name' => 'Slovenia',]; | |
$countries['SK'] = ['name' => 'Slovakia',]; | |
return $countries; | |
} | |
?> |
$countries['GB'] = ['name' => 'United Kingdom',];
Cough Cough :) #Brexit :)
@PhilETaylor Lol
This structure would have made search by name doable:
$countries= [ [ 'code' => 'AT', 'name'=>'Austria'], [ 'code' => 'BE', 'name'=>'Belgium'], ... ];
Cheers
GB is no longer in the EU, so this line should be removed
$countries['GB'] = ['name' => 'United Kingdom',];
👍
@PhilETaylor can you explain the difference between the two? Thanks
Sure - I have to quote this at least once a month as I live in Jersey, Channel Islands, which are also not in the UK, but often people say we are (Ref: https://www.gov.je/Leisure/Jersey/pages/profile.aspx)
GB = "England, Scotland and Wales make up Great Britain"
UK = "The United Kingdom includes Great Britain (England, Scotland and Wales) and Northern Ireland"
Very interesting, thank you!
You're a life saver :) Thank you!