You are here

public function GeoIpHandlerInterface::cityName in GeoIP API 7.2

The city name for a given IP.

Defaults to using the current user's IP if not specified. This function only works with the city level database and will return false in all other cases.

Parameters

string $ip: The ip to resolve.

Return value

string|FALSE The city name or FALSE on failure (e.g. the country db is used).

2 methods override GeoIpHandlerInterface::cityName()
GeoIpHandlerV1::cityName in src/GeoIpHandlerV1.php
The city name for a given IP.
GeoIpHandlerV2::cityName in src/GeoIpHandlerV2.php
The city name for a given IP.

File

src/GeoIpHandlerInterface.php, line 130
The GeoIP API Interface.

Class

GeoIpHandlerInterface

Namespace

Drupal\geoip

Code

public function cityName($ip = NULL);