function _location_driving_directions_link_ch_search in Location 6.3
Same name and namespace in other branches
- 5.3 supported/location.ch.inc \_location_driving_directions_link_ch_search()
- 7.5 supported/location.ch.inc \_location_driving_directions_link_ch_search()
- 7.3 supported/location.ch.inc \_location_driving_directions_link_ch_search()
- 7.4 supported/location.ch.inc \_location_driving_directions_link_ch_search()
1 call to _location_driving_directions_link_ch_search()
- location_driving_directions_link_ch in supported/
location.ch.inc
File
- supported/
location.ch.inc, line 88
Code
function _location_driving_directions_link_ch_search($location_a, $location_b) {
$query_params_a = array();
$query_params_b = array();
foreach (array(
'street',
'postal_code',
'city',
) as $field) {
if (isset($location_a[$field])) {
$query_params_a[] = $location_a[$field];
}
if (isset($location_b[$field])) {
$query_params_b[] = $location_b[$field];
}
}
return 'http://route.search.ch/?route=' . urlencode(implode(' ', $query_params_a) . ' to ' . implode(' ', $query_params_b));
}