Province/State abbreviations (US/Canada)

Just in case someone’s looking for this.

function getStateStrByAbbr( $abbr ) {
switch($abbr):
// Canada Province
case 'AB': return 'Alberta'; break;
case 'BC': return 'British Columbia'; break;
case 'MB': return 'Manitoba'; break;
case 'NB': return 'New Brunswick'; break;
case 'NL': return 'Newfoundland and Labrador'; break;
case 'NT': return 'Northwest Territories'; break;
case 'NS': return 'Nova Scotia'; break;
case 'NU': return 'Nunavut'; break;
case 'ON': return 'Ontario'; break;
case 'PE': return 'Prince Edward Island'; break;
case 'QC': return 'Quebec'; break;
case 'SK': return 'Saskatchewan'; break;
case 'YT': return 'Yukon'; break;
// US state
case 'AL': return 'Alabama'; break;
case 'AK': return 'Alaska'; break;
case 'AZ': return 'Arizona'; break;
case 'AR': return 'Arkansas'; break;
case 'CA': return 'California'; break;
case 'CO': return 'Colorado'; break;
case 'CT': return 'Connecticut'; break;
case 'DE': return 'Delaware'; break;
case 'DC': return 'District of Columbia'; break;
case 'FL': return 'Florida'; break;
case 'GA': return 'Georgia'; break;
case 'HI': return 'Hawaii'; break;
case 'ID': return 'Idaho'; break;
case 'IL': return 'Illinois'; break;
case 'IN': return 'Indiana'; break;
case 'IA': return 'Iowa'; break;
case 'KS': return 'Kansas'; break;
case 'KY': return 'Kentucky'; break;
case 'LA': return 'Louisiana'; break;
case 'ME': return 'Maine'; break;
case 'MD': return 'Maryland'; break;
case 'MA': return 'Massachusetts'; break;
case 'MI': return 'Michigan'; break;
case 'MN': return 'Minnesota'; break;
case 'MS': return 'Mississippi'; break;
case 'MO': return 'Missouri'; break;
case 'MT': return 'Montana'; break;
case 'NE': return 'Nebraska'; break;
case 'NV': return 'Nevada'; break;
case 'NH': return 'New Hampshire'; break;
case 'NJ': return 'New Jersey'; break;
case 'NM': return 'New Mexico'; break;
case 'NY': return 'New York'; break;
case 'NC': return 'North Carolina'; break;
case 'ND': return 'North Dakota'; break;
case 'OH': return 'Ohio'; break;
case 'OK': return 'Oklahoma'; break;
case 'OR': return 'Oregon'; break;
case 'PA': return 'Pennsylvania'; break;
case 'PR': return 'Puerto Rico'; break;
case 'RI': return 'Rhode Island'; break;
case 'SC': return 'South Carolina'; break;
case 'SD': return 'South Dakota'; break;
case 'TN': return 'Tennessee'; break;
case 'TX': return 'Texas'; break;
case 'UT': return 'Utah'; break;
case 'VI': return 'Virgin Islands of United States'; break;
case 'VT': return 'Vermont'; break;
case 'VA': return 'Virginia'; break;
case 'WA': return 'Washington'; break;
case 'WV': return 'West Virginia';break;
case 'WI': return 'Wisconsin'; break;
case 'WY': return 'Wyoming'; break;
endswitch;
}

One Response to “Province/State abbreviations (US/Canada)”

  1. Thanks for share with us state about US and Canada.I love this blog

Leave a Reply