function getdirections_latlon_check in Get Directions 6.2
Same name and namespace in other branches
- 7.3 getdirections.module \getdirections_latlon_check()
- 7.2 getdirections.module \getdirections_latlon_check()
Function to check a lat,lon string
Parameters
string $latlon:
Return value
Returns true or false
12 calls to getdirections_latlon_check()
- getdirections_latlon in ./
getdirections.module - Function to setup the map and form
- getdirections_latlons in ./
getdirections.module - getdirections_latlon_load in ./
getdirections.module - getdirections_n2u_setlocation in ./
getdirections.module - Function to setup the map
- getdirections_setlocation in ./
getdirections.module - Function to setup the map and form
File
- ./
getdirections.module, line 1359 - Fetches google map directions.
Code
function getdirections_latlon_check($latlon) {
if (!empty($latlon) && preg_match("/[0-9.\\-],[0-9.\\-]/", $latlon)) {
$ll = explode(',', $latlon);
if (isset($ll[0]) && is_numeric($ll[0]) && $ll[0] != 0 && isset($ll[1]) && is_numeric($ll[1]) && $ll[1] != 0) {
return $latlon;
}
}
return FALSE;
}