You are here

function geoip_rules_condition_country_compare in GeoIP API 7.2

Checks if the detected country matches to one in the list.

Parameters

array $countries: List of countries to check against.

Return value

bool TRUE if the country code is in the list.

1 string reference to 'geoip_rules_condition_country_compare'
geoip_rules_condition_info in ./geoip.rules.inc
Implements hook_rules_action_info().

File

./geoip.rules.inc, line 51
Rules integration of the geoip module

Code

function geoip_rules_condition_country_compare($countries) {
  if (!is_array($countries)) {
    $countries = explode('\\n', strtoupper($countries));
  }
  return in_array(geoip_country_code(), $countries);
}