GeoIP PHP API v3.5.0

ProviderInterface

Table of Contents

Methods

city()  : City
country()  : Country

Methods

city()

public city(string $ipAddress) : City
Parameters
$ipAddress : string

an IPv4 or IPv6 address to lookup

Tags
throws
GeoIp2Exception

if the address is not found or a web service error occurs

InvalidDatabaseException

if the database is invalid

BadMethodCallException

if the database does not support the lookup or is closed

InvalidArgumentException

if the address is invalid or unsupported by the database

RuntimeException

if the database decoder or HTTP client cannot run

Return values
City —

a City model for the requested IP address

country()

public country(string $ipAddress) : Country
Parameters
$ipAddress : string

an IPv4 or IPv6 address to lookup

Tags
throws
GeoIp2Exception

if the address is not found or a web service error occurs

InvalidDatabaseException

if the database is invalid

BadMethodCallException

if the database does not support the lookup or is closed

InvalidArgumentException

if the address is invalid or unsupported by the database

RuntimeException

if the database decoder or HTTP client cannot run

Return values
Country —

a Country model for the requested IP address

On this page

Search results