Skip to content

functions_modules_geoip

Daniel Spors edited this page Feb 14, 2023 · 2 revisions

Functions in file modules/geoip.php

geoip_init

Modul to localize ip-adresses. Uses the free version of GeoIP from maxmind. In the majority of cases maxmind publishes updates for the GeoLiteCity.dat on the first day each month.

Definition: public function geoip_init()

Returns: void

get_geo_location_by_ip

Resolves an IP address to a location.

Definition: public function get_geo_location_by_ip($ip_address=null)

Returns: stdClass|false Object containing location information

Parameters:

get_geo_region

Returns the region name for the current IP address See get_ip_address

Definition: public function get_geo_region()

Returns: string Location name or empty string if unknown

get_coordinates_by_ip

Resolves an IP address to geo coordinates.

Definition: public function get_coordinates_by_ip($ip=false)

Returns: array|false Associative array with keys 'latitude' and 'longitude'

Parameters:

get_countrycode_by_ip

Resolves an IP address to a country code

Definition: public function get_countrycode_by_ip($ipaddr=false)

Returns: array|bool Country code or empty string if not found

Parameters:

get_countryname_by_ip

Returns the country name from the current IP See get_ip_address

Definition: public function get_countryname_by_ip()

Returns: string Country name or empty string if unknown

get_timezone_by_ip

Returns the timezone for an IP address.

Definition: public function get_timezone_by_ip($ip=false)

Returns: string Timezone identifier or false on error

Parameters:

Clone this wiki locally