|
| IP2Location is a PHP module that enables the user to
find the country, region, city, coordinates, zip code, ISP and domain name that
any IP address or host name originates from. It has been optimized for speed
and memory utilization. Developers can use the API to query all IP2Location™
binary databases for applications supporting PHP. |
| |
|
|
|
|
| |
| |
Download - Sample .BIN Files |
|
|
|
|
| Note: The demo version of Binary (.BIN)
data file consists of IP address range from 0.0.0.0 to 99.255.255.255. The
complete Binary (.BIN) data file is available for all paid subscribers at no
extra cost. Please contact our sales department for the download information. |
| |
| |
Complete .BIN Files (Subscription Required)
|
|
|
|
|
| |
|
|
| Browse sample-IP2Location.php using any web browser
through web server. |
| |
|
|
| IP2Location_open(filename,
mode)
|
Open IP2Location binary database from a
local path. |
|
| IP2Location_get_all(IP2Location,
ip_address)
|
Returns an array of country short name, country long
name, region, city, latitude, longitude and domain name for an IP address. |
|
|
| IP2Location_close(IP2Location) |
Close IP2Location binary database from a local path. |
|
| |
|
|
|
<?php
include("IP2Location.inc.php");
$ip = IP2Location_open("samples/IP-COUNTRY-SAMPLE.BIN", IP2LOCATION_STANDARD);
$record = IP2Location_get_all($ip, "35.1.1.1");
echo "$record->country_short : " . $record->country_short;
echo "$record->country_long : " . $record->country_long;
echo "$record->region : " . $record->region;
echo "$record->city : " . $record->city;
echo "$record->isp : " . $record->isp;
echo "$record->latitude : " . $record->latitude;
echo "$record->longitude : " . $record->longitude;
echo "$record->domain : " . $record->domain;
echo "$record->zipcode : " . $record->zipcode;
echo "$record->timezone : " . $record->timezone;
echo "$record->netspeed : " . $record->netspeed;
echo "$record->ipaddr : " . $record->ipaddr;
echo "$record->ipno : " . $record->ipno;
IP2Location_close($ip);
?>
|
| |
| |
| |