public function Ip2CountryLookupInterface::getCountry in IP-based Determination of a Visitor's Country 8
Gets the ISO 3166 2-character country code from the IP address.
Parameters
string|int|null $ip_address: IP address either as a dotted quad string (e.g. "127.0.0.1") or as a 32-bit unsigned long integer.
Return value
string|false ISO 3166-1 2-character country code for this IP address, or FALSE if the lookup failed to find a country.
1 method overrides Ip2CountryLookupInterface::getCountry()
- Ip2CountryLookup::getCountry in src/
Ip2CountryLookup.php - Gets the ISO 3166 2-character country code from the IP address.
File
- src/
Ip2CountryLookupInterface.php, line 21
Class
- Ip2CountryLookupInterface
- Interface for Ip2CountryLookup.
Namespace
Drupal\ip2countryCode
public function getCountry($ip_address = NULL);