17 Oct

countries in europe

Just a quickie. I had to see if a selected country (selected by 3-letter code) was in Europe, but couldn’t find a handy function online for it.

So, here it is:

function inEurope($code){
  return in_array($code,array(

That returns true or false depending on whether the submitted $code (an “ISO 3166-1 alpha-3” code) is in Europe or not.