Documentation

Localization


Localization

get_ip()
Return the ip of the logged user

$id = get_ip( $ip );



is_ip( ip )

Return true if there is a valid ip. Use IP to get the IP of the user connected to the script.

$id = is_ip( $ip );



ip_to_location( ip )

Retrieve the geolocation info of the selected $ip, contacting ipinfodb.com.
In order to use this function you must ask for an ipinfodb key, and set the constant IPINFODB_KEY.

dump( ip_to_location( IP ) );

it will output:

dump 
----------------------

stdClass Object
(
[Status] => OK
[CountryCode] => US
[CountryName] => United States
[RegionCode] => 48
[RegionName] => Texas
[City] => Houston
[ZipPostalCode] => 77002
[Latitude] => 29.7523
[Longitude] => -95.367
[Gmtoffset] => -21600
[Dstoffset] => 0
[TimezoneName] => America/New York
[Isdst] => 0
[Ip] => hidden for privacy
)

----------------------

 

get_browser_info()
Return the browser info of the selected user

list( $lang_id, $browser, $version, $os ) = get_browser_info( );