To retrieve a stored value use the following code:
$city_selector = get_field('field_name');
If you use get_post_meta() to retrieve the value, you won't get the result as shown below, because the plugin applies some filters on the return.
The variable $city_selector returns 5 values in an array:
array(5) {
["countryCode"]=>
string(2) "NL"
["stateCode"]=>
string(5) "NH"
["cityName"]=>
string(9) "Amsterdam"
["stateName"]=>
string(13) "Noord-Holland"
["countryName"]=>
string(11) "Netherlands"
}
Use it as follows:
$city_selector = get_field('field_name');
echo 'I live in ' . $city_selector['cityName'];
echo 'which is in ' . city_selector['stateName'] . ' (' . city_selector['stateCode'] . ')';
echo ' which lies in the country ' . $city_selector['country'] . ' (' . $city_selector['countryCode'] . ')';
This outputs:
"I live in Amsterdam which is in Noord-Holland (NH) which lies in the country Netherlands (NL)"