Skip to content

functions_modules_ip2location

Daniel Spors edited this page Feb 14, 2023 · 1 revision

Functions in file modules/ip2location.php

ip2location_init

Module to localize ip-addresses. Uses IP2Location Needs 'composer require ip2location/ip2location-php'

Definition: public function ip2location_init()

Returns: void

get_geo_location_by_ip

Resolves an IP address to a location.

Definition: public function get_geo_location_by_ip($ip=false)

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($ip=false)

Returns: string|false Location name or empty string if unknown

Parameters:

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($ip=false)

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

Parameters:

get_countryname_by_ip

Returns the country name from the current IP

Definition: public function get_countryname_by_ip($ip=false)

Returns: string|false Country name or empty string if unknown

Parameters:

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