library freegeoip-php
IP geolocation web server in PHP
alxhotel/freegeoip-php
IP geolocation web server in PHP
- Wednesday, August 10, 2016
- by alxhotel
- Repository
- 1 Watchers
- 0 Stars
- 1 Installations
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Freegeoip service in PHP
DO NOT use this in production, (*1)
Installation
composer require alxhotel/freegeoip-php
Usage
<?php
// Create freegeoip object
$freegeoip = new Freegeoip();
// Get client
$clent = $freegeoip->client;
// Test IP
$output = $client->lookup("8.8.8.8");
// Print output
print_r($output);
/*
Array
(
[ip] => 8.8.8.8
[country_code] => US
[country_name] => United States
[region_code] => CA
[region_name] => California
[city] => Mountain View
[zip_code] => 94035
[time_zone] => America/Los_Angeles
[latitude] => 37.386
[longitude] => -122.0838
[metro_code] => 807
)
*/
dev-master
9999999-dev
IP geolocation web server in PHP
Sources
Download
MIT
The Requires