

You are recommended to visit the above links to download the latest BIN database. IP2Location Commercial BIN Data (Comprehensive): Īn outdated BIN database was provided in the databases folder for your testing.This library requires IP2Location BIN data file to function.
#IP2LOCATION CODE#
Provide a ISO 3166 country code and the region name to get ISO 3166-2 subdivision code for the region. String getRegionCode($countr圜ode, $regionName) Function NameĮxpect a IP2Location ISO 3166-2 Subdivision Code CSV file. Below is the information returned:īelow is the description of the functions available in the Region class.

#IP2LOCATION FULL#
Will return a full list of countries information if country code not provided.

Provide a ISO 3166 country code to get the country information in array. Function NameĮxpect a IP2Location Country Information CSV file. If an array of $ipData is supplied, it will return the list of IP address data found.īelow is the description of the functions available in the Country class. Return the real IP address of the visitor. Return null on error.Ĭonvert IPv4 range into a list of IPv4 CIDR notation.Ĭonvert IPv4 CIDR notation into a list of IPv4 addresses.Ĭonvert IPv6 range into a list of IPv6 CIDR notation.Ĭonvert IPv6 CIDR notation into a list of IPv6 addresses. Translate IPv6 address from decimal number into hexadecimal address. Translate IPv6 address from hexadecimal address to decimal format. Translate IPv4 address from decimal number to dotted-decimal address. Translate IPv4 address from dotted-decimal address to decimal format. Verify if a string is a valid IPv6 address. Verify if a string is a valid IPv4 address. Return remaining credit of the web service account.īelow is the description of the functions available in the IpTools class. Return an array of the complete IP list in CIDR format of the detected row record based on the given IP address.īelow is the description of the functions available in the WebService class. Note: although the above names are not exactly matched with the names given in this link, but they are self-described. You can visit IP2Location for the description of each field. Return the database's type, 1 to 25 respectively for DB1 to DB25. Return the database's compilation date as a string of the form 'YYYY-MM-DD' Full path of IP2Location BIN data file.įor SHARED_MEMORY and MEMORY_CACHE, it will require your server to have sufficient memory to hold the BIN data, otherwise it will raise the errors during the object initialization.Database Classīelow is the description of the functions available in the Database class. You can check the example.php file to learn more about usage. To test this installation, please browse examples/example.php using web browser.
#IP2LOCATION INSTALL#
Install this package using composer as below: composer require ip2location/ip2location-php There are more than 13 types of information that you can retrieve from an IP address. If you require different granularity of IP information, you can visit to download the relevant BIN file, and the information will made ready for you. That's it, and no code modification needed. If you would like to enable IPv6 support, you just need to replace your BIN file with IPv6 version.
#IP2LOCATION UPDATE#
Monthly update is available for both IP2Location LITE and commercial database.
