This was useful when using the shipping address PayPal returns for CA addresses to get rates from the UPS API. The UPS API seems to only accept CA provinces as the two-digit code, PayPal sends it back is full words.

$caProv = array("Alberta" => "AB",
"British Columbia" => "BC",
"Manitoba" => "MB",
"New Brunswick" => "NB",
"Newfoundland and Labrador" => "NL",
"Northwest Territories" => "NT",
"Nova Scotia" => "NS",
"Nunavut" => "NU",
"Ontario" => "ON",
"Prince Edward Island" => "PE",
"Quebec" => "QC",
"Saskatchewan" => "SK",
"Yukon" => "YT");
$state = ($httpParsedResponseAr['SHIPTOCOUNTRYCODE'] == "CA") ? $caProv[$httpParsedResponseAr['SHIPTOSTATE']] : $httpParsedResponseAr['SHIPTOSTATE'];