You are here

function getlocations_latlon_check in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_latlon_check()
  2. 7.2 getlocations.module \getlocations_latlon_check()
  3. 7 getlocations.module \getlocations_latlon_check()

Function to check a lat,lon string

Parameters

string $latlon:

Return value

Returns true or false

8 calls to getlocations_latlon_check()
getlocations_lids in ./getlocations.module
Menu callback
getlocations_nids in ./getlocations.module
Menu callback
getlocations_nodemap in ./getlocations.module
Menu callback
getlocations_settings_validate in ./getlocations.admin.inc
getlocations_typemap in ./getlocations.module
Menu callback

... See full list

File

./getlocations.module, line 785
Displays locations on a map. for Drupal 6 using version 3 googlemaps API

Code

function getlocations_latlon_check($latlon) {
  if (!empty($latlon) && preg_match("/[0-9.\\-],[0-9.\\-]/", $latlon)) {
    $ll = explode(',', $latlon);
    if (!($ll[0] == 0 && $ll[1] == 0) && isset($ll[0]) && is_numeric($ll[0]) && isset($ll[1]) && is_numeric($ll[1])) {
      return $latlon;
    }
  }
  return FALSE;
}