|
Rych_Ip2Location
Description of the Rych_Ip2Location component
Rych_Ip2LocationThis component provides simple access to the commercial ip2location.com IP geolookup databases. In order to use this component, you will have to purchase a subscription to the database files from ip2location.com. <?php
// Load library with the sample file
$ip2loc = new Rych_Ip2Location('./ip2location-database.bin');
// Perform a lookup and get an instance of Rych_Ip2Location_Record
$record = $ip2loc->lookup('70.86.96.219');
echo "{$record->ipAddress}:" . PHP_EOL;
echo " Latitude: {$record->latitude}" . PHP_EOL;
echo " Longitude: {$record->longitude}" . PHP_EOL;Fields available in the record object are:
Any field that is not supported by the given database file will return Rych_Ip2Location::NOT_SUPPORTED. |
► Sign in to add a comment