Geo IP class.

category OSS
package OSS_GeoIP
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Returns the two letter country code of a given IP (or an error code)

getCountryCode(string $ip) : string
Static

Error codes: 10 - GeoIP is not installed 11 - Country database is not available 12 - Unknown / empty result. RFC1918?

Parameters

$ip

string

The IP to look up

Returns

stringThe two letter country code (or error code)

Returns the timezone for a IP (or the default on error)

getTimezone(string $ip, string $default) : string
Static

Parameters

$ip

string

The IP to look up

$default

string

The default timezone to use on error

Returns

stringThe timezone (e.g. 'Europe/Dublin')