PHP Array Of Canadian States

23rd April 2009

Use the following array to print out a list of Canadian states, also know as provinces.

  1. $canadian_states = array(
  2. "BC" => "British Columbia",
  3. "ON" => "Ontario",
  4. "NL" => "Newfoundland and Labrador",
  5. "NS" => "Nova Scotia",
  6. "PE" => "Prince Edward Island",
  7. "NB" => "New Brunswick",
  8. "QC" => "Quebec",
  9. "MB" => "Manitoba",
  10. "SK" => "Saskatchewan",
  11. "AB" => "Alberta",
  12. "NT" => "Northwest Territories",
  13. "NU" => "Nunavut",
  14. "YT" => "Yukon Territory"
  15. );

Here is the same array, but with the French versions of the states.

  1. $canadian_states = array(
  2. "AB" => "Alberta",
  3. "BC" => "Colombie-Britannique",
  4. "MB" => "Manitoba",
  5. "NB" => "Nouveau-Brunswick",
  6. "NL" => "Terre-Neuve-et-Labrador",
  7. "NS" => "Nouvelle-Écosse",
  8. "NT" => "Territoires du Nord-Ouest",
  9. "NU" => "Nunavut",
  10. "ON" => "Ontario",
  11. "PE" => "Île-du-Prince-Édouard",
  12. "QC" => "Québec",
  13. "SK" => "Saskatchewan",
  14. "YT" => "Yukon"
  15. );

Comments

Permalink
Thanks man!

kido (Wed, 10/30/2013 - 13:15)

Permalink
You forgot to add commas at the end of each line ... but thanks anyway!

jell0wed (Tue, 07/01/2014 - 20:57)

Permalink
One more comma needed! Line 13 after "Nunavut"

Craig (Mon, 12/22/2014 - 04:28)

Add new comment

The content of this field is kept private and will not be shown publicly.