2017 © Pedro Peláez
 

library ip2location-php

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

image

ip2location/ip2location-php

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  • Friday, March 2, 2018
  • by chrislim2888
  • Repository
  • 5 Watchers
  • 51 Stars
  • 196,137 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 32 Forks
  • 2 Open issues
  • 11 Versions
  • 16 % Grown

The README.md

IP2Location (PHP Module)

Latest Stable Version Total Downloads, (*1)

This is the official release maintained by IP2Location.com, (*2)

This PHP module provides fast lookup of country, region, district, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation, usage type, address type, IAB category and ASN from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com., (*3)

This module can be used in many types of projects such as:, (*4)

  1. select the geographically closest mirror
  2. analyze your web server logs to determine the countries of your visitors
  3. credit card fraud detection
  4. software export controls
  5. display native language and currency
  6. prevent password sharing and abuse of service
  7. geotargeting in advertisement

Free IP2Location LITE and commerical databases are available for download. * LITE database is available at https://lite.ip2location.com (Free with limited accuracy) * Commercial database is availabe at https://www.ip2location.com (Comprehensive with high accuracy), (*5)

Monthly update is available for both IP2Location LITE and commercial database., (*6)

KEY FEATURES

  1. Support both IPv4 and IPv6 with ease. If you would like to enable IPv6 support, you just need to replace your BIN file with IPv6 version. That's it, and no code modification needed.
  2. Extensible. If you require different granularity of IP information, you can visit IP2Location.com to download the relevant BIN file, and the information will made ready for you.
  3. Comprehensive Information. There are more than 13 types of information that you can retrieve from an IP address. Please visit IP2Location.com for details.

Developer Documentation

To learn more about installation, usage, and code examples, please visit the developer documentation at https://ip2location-php.readthedocs.io/en/latest/index.html., (*7)

DEPENDENCIES

This library requires IP2Location BIN data file to function. You may download the BIN data file at * IP2Location LITE BIN Data (Free): https://lite.ip2location.com * IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com, (*8)

An outdated BIN database was provided in the databases folder for your testing. You are recommended to visit the above links to download the latest BIN database., (*9)

You can also sign up for IP2Location Web Service to lookup by IP2Location API., (*10)

BIN DOWNLOADER SCRIPT

php ip2location_bin_download.php --token DOWNLOAD_TOKEN --file DATABASE_CODE -y

The command above will download the DATABASE_CODE BIN file and unzip the file into data folder., (*11)

Parameters Description
token Download token. You can get your token at your IP2Location Account Area at the Download page.
file Database package. (DB1BIN...DB26BIN, DB1BINIPV6...DB26BINIPV6, DB1LITEBIN...DB11LITEBIN or DB1LITEBINIPV6...DB11LITEBINIPV6) You may login to your IP2Location Account Area and get the package code (or download code) at the Download page.
y Auto replace the current BIN file without acknowledgement.

You can set the DOWNLOAD_TOKEN and DATABASE_CODE with values in the .env file (same path as ip2location_bin_download.php) and run the command php ip2location_bin_download.php for the download., (*12)

IPv4 BIN vs IPv6 BIN

  • Use the IPv4 BIN file if you just need to query IPv4 addresses.
  • Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

OTHER FRAMEWORK LIBRARY

Below are the list of other framework library that you can install and use right away. * IP2Location Laravel * IP2Location CakePHP * IP2Location CodeIgniter * IP2Location Yii * Symfony Framework. Tutorial on the Symfony implementation., (*13)

Copyright (C) 2005-2024 by IP2Location.com, (*14)

License under MIT, (*15)

The Versions

02/03 2018

dev-master

9999999-dev http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

MIT LGPLv3

geolocation ip2location ip2locationlite

02/10 2016

8.0.2

8.0.2.0 http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

01/08 2016

8.0.1

8.0.1.0 http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

05/07 2016

8.0.0

8.0.0.0 http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

10/06 2016

7.2.5

7.2.5.0 http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

07/01 2016

7.2.4

7.2.4.0 http://www.ip2location.com

[Official Release] IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

27/10 2015

7.2.3

7.2.3.0 http://www.ip2location.com

IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

30/07 2015

7.2.2

7.2.2.0 http://www.ip2location.com

IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

29/07 2015

7.2.0

7.2.0.0 http://www.ip2location.com

IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

19/06 2015

7.0.1

7.0.1.0 http://www.ip2location.com

IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip2location ip2locationlite

18/09 2014

7.0.0

7.0.0.0 http://www.ip2location.com

IP2Location PHP API to get location info from IPv4 and IPv6 address.

  Sources   Download

LGPLv3

geolocation ip ip2location ip2locationlite