function _google_geocode_flatten in Location 6.3
Same name and namespace in other branches
- 5.3 geocoding/google.inc \_google_geocode_flatten()
- 7.5 geocoding/google.inc \_google_geocode_flatten()
- 7.3 geocoding/google.inc \_google_geocode_flatten()
- 7.4 geocoding/google.inc \_google_geocode_flatten()
1 call to _google_geocode_flatten()
- google_geocode_location in geocoding/google.inc
- Perform a geocode on a location array.
File
- geocoding/google.inc, line 83
- Google geocoder.
Code
function _google_geocode_flatten($location = array()) {
if (empty($location)) {
return '';
}
$address = '';
if (!empty($location['street'])) {
$address .= $location['street'];
}
if (!empty($location['city'])) {
if (!empty($address)) {
$address .= ', ';
}
$address .= $location['city'];
}
if (!empty($location['province_name'])) {
if (!empty($address)) {
$address .= ', ';
}
$address .= $location['province_name'];
}
if (!empty($location['postal_code'])) {
if (!empty($address)) {
$address .= ', ';
}
$address .= $location['postal_code'];
}
if (!empty($location['country'])) {
if (!empty($address)) {
$address .= ', ';
}
$address .= $location['country'];
}
return $address;
}