You are here

function _ip_geoloc_extract_value in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 ip_geoloc.module \_ip_geoloc_extract_value()

Extracts a Views argument value from the supplied string.

Parameters

string $string: The string to parse.

array $view_args: The View arguments.

Return value

string The extracted value.

1 call to _ip_geoloc_extract_value()
ip_geoloc_is_in_range in ./ip_geoloc.module
Determines if a value is within the supplied numeric or alphabetical range.

File

./ip_geoloc.module, line 788
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported. and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function _ip_geoloc_extract_value($string, $view_args) {
  if (preg_match('/^!([0-9])/', $string, $matches)) {
    $arg = $matches[1];
    return isset($view_args[$arg - 1]) ? $view_args[$arg - 1] : arg($arg);
  }
  return $string;
}