2017 © Pedro Peláez
 

library geoip2

Extended MaxMind GeoIP2 PHP API

image

tuandm/geoip2

Extended MaxMind GeoIP2 PHP API

  • Friday, August 18, 2017
  • by tuandm
  • Repository
  • 1 Watchers
  • 7 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

geoip2

Full package for GeoIP2-PHP, (*1)

This library is a wrapper of https://github.com/maxmind/GeoIP2-php which uses to get geo information from IP. The database file is included. No need to download the database file (http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz) and construct the Reader instance with the file path., (*2)

  use Tuandm\Database\Reader;

  include_once "vendor/autoload.php";

  $reader = new Reader();
  // Or construct with mmdb file
  // $reader = new Reader('/path/to/mmdb_file');
  $record = $reader->city('52.192.103.163');

  echo $record->city->name; // Tokyo

  // We can also create Reader instance for reading country database
  $reader = Reader::forCountry();
  $record = $reader->country('52.192.103.163');

The Versions

18/08 2017

dev-master

9999999-dev https://github.com/tuandm/geoip2

Extended MaxMind GeoIP2 PHP API

  Sources   Download

MIT

The Requires

 

geoip geolocation ip maxmind geoip2