Ben
Ben is a lifelong Nintendo fan who likes to build websites, and make video games. He buys way too much Lego.
WordPress and Games
As web designers, sometimes we need to work with lists of countries. For instance there is a new EU cookie law coming into action soon – that only applies to Europe. There is a worldwide standard that gives each country a 2 letter code.
The country code standard makes it easy for developers to combine different API’s consistently (standards are good). However there’s loads of country codes – and in order to fulfil our legal obligations I needed a list of 2 letter country codes applicable to Europe only. So, I created a list of codes that you can see (and use) below.
For a full list of all the ISO 2 letter country codes check out the Wikipedia page on the subject.
Since I made it for myself, here’s the list as a nice handy PHP array as well.
<?php $eu_countries = array( 'AL', 'AD', 'AM', 'AT', 'BY', 'BE', 'BA', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FO', 'FI', 'FR', 'GB', 'GE', 'GI', 'GR', 'HU', 'HR', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MK', 'MT', 'NO', 'NL', 'PL', 'PT', 'RO', 'RS', 'RU', 'SE', 'SI', 'SK', 'SM', 'TR', 'UA', 'VA', ); ?>