تابع ووکامرسی wc_format_country_state_string تبدیل رشته کشور:ایالت به آرایه

تابع ووکامرسی wc_format_country_state_string – تبدیل نوع داده رشته ای کشور:ایالت به نوع داده آرایه ای
Syntax – سینتکس
(array) wc_format_country_state_string( (number) $country_string );
Parameters – پارامتر ها (1)
- 1- $country_string (number)
Usage – نحوه استفاده
if ( !function_exists( 'wc_format_country_state_string' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php';
}
// The country string.
$country_string = null;
// NOTICE! Understand what this does before running.
$result = wc_format_country_state_string($country_string);
Defined – محل تعریف
/includes/wc-core-functions.php
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,
);
}
versions – نسخه ها
از نسخه : 2.3.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر