public function GeoIpHandlerInterface::countryCode in GeoIP API 7.2
Returns the ISO 3166-2 country code for a given IP.
Defaults to using the current user's IP if not specified.
Parameters
string $ip: The ip to resolve.
Return value
string|FALSE Country code or FALSE on failure. Code is always upper case.
2 methods override GeoIpHandlerInterface::countryCode()
- GeoIpHandlerV1::countryCode in src/
GeoIpHandlerV1.php - Returns the ISO 3166-2 country code for a given IP.
- GeoIpHandlerV2::countryCode in src/
GeoIpHandlerV2.php - Returns the ISO 3166-2 country code for a given IP.
File
- src/
GeoIpHandlerInterface.php, line 72 - The GeoIP API Interface.
Class
Namespace
Drupal\geoipCode
public function countryCode($ip = NULL);