Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I have the conversion between iso2 and iso3 working properly for the letter codes. But if I want to convert between iso2 and the iso3 number code or vice versa it starts acting strange.
For example. Entering an iso3 number code of '004' (Afghanistan) should return 'AF' but it returns 'DZ' (Algeria) instead. Algeria has a country code of '012'
So I tried '012' and it returned 'AM' (Armenia) which has a country code of '051'
this is the code I'm using:
$iso2 = country_load($numcode)->iso2;
Comments
Comment #1
AgentJay CreditAttribution: AgentJay commentedUsing iso2 to iso3 works fine for the letter codes.
$iso3 = country_load($iso2)->iso3;
It's just the numbers that are not working for me.
Comment #2
AgentJay CreditAttribution: AgentJay commentedComment #3
Alan D. CreditAttribution: Alan D. commentedAs per the Readme