You are here

function geoip_raw_record in GeoIP API 7.2

Returns the country code for a given IP.

Parameters

string $ip: The ip to resolve, defaults to the current users ip.

Return value

string|FALSE Country Code or FALSE on error.

Related topics

File

./geoip.module, line 213
API for using the MaxMind GeoLite Country database.

Code

function geoip_raw_record($ip = NULL) {
  $ip = $ip ? $ip : geoip_ip_address();
  if ($gi = geoip_instance()) {
    return $gi
      ->rawRecord($ip);
  }
  return FALSE;
}