function addressfield_tokens_state in Addressfield Tokens 7
Gets the name of the state with the given abbreviation.
Parameters
string $country: The 2-letter abbreviation of the country.
string $state: The 2-letter abbreviation of the state.
Return value
string The name of the state, or FALSE.
3 calls to addressfield_tokens_state()
File
- ./
addressfield_tokens.module, line 390 - Main components.
Code
function addressfield_tokens_state($country, $state) {
$states = addressfield_tokens_states($country);
// State abbreviations will usually be two uppercase letters.
$state_upper = drupal_strtoupper($state);
if (!empty($state_upper) && !empty($states[$state_upper])) {
return check_plain($states[$state]);
}
return check_plain($state);
}