What is the best way to take any 2 character country code (i.e. us) that is stored in the location table in the database and display it as the appropriate full country name (i.e. "United States") when I'm creating a custom theme for the user profile page?

Thanks,
Spencer

Comments

spanders’s picture

This worked for me.

<?php
$country_names = location_get_iso3166_list(); 
print $country_names[$user->location['country']] ?>
?>
summit’s picture

Great code! greetings, Martijn