'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', 'NB' => 'New Brunswick', 'NL' => 'Newfoundland And Labrador', 'NS' => 'Nova Scotia', 'ON' => 'Ontario', 'PE' => 'Prince Edward Island', 'QC' => 'Quebec', 'SK' => 'Saskatchewan', 'NT' => 'Northwest Territories', 'NU' => 'Nunavut', 'YT' => 'Yukon' ]; /** * Get the name of the province or territory for a given abbreviation. * * @param string $abbreviation * @return string */ public static function getName($abbreviation) { return self::$provinces[$abbreviation]; } /** * Get all provinces and territories. * * @return array */ public static function get() { return self::$provinces; } /** * Get the abbreviation for a given province or territory name. * * @param string $name * @return string */ public static function getAbbreviation($name) { return array_search(ucwords($name), self::$provinces); } }