wc_format_country_state_string()
Formats a string in the format COUNTRY:STATE into an array.
Хуков нет.
Возвращает
Массив.
Использование
wc_format_country_state_string( $country_string );
- $country_string(строка) (обязательный)
- Country string.
Список изменений
| С версии 2.3.0 | Введена. |
Код wc_format_country_state_string() wc format country state string WC 10.9.4
function wc_format_country_state_string( $country_string ) {
if ( strstr( $country_string, ':' ) ) {
list( $country, $state ) = explode( ':', $country_string );
} else {
$country = $country_string;
$state = '';
}
return array(
'country' => $country,
'state' => $state,
);
}