You might also like: Applying Hexagonal Architecture to a Symfony Project Free BIN databases are available for download at IP2Location LITE database. This tutorial uses the IP2Location module, available at, to query IP information from BIN database.
In this tutorial, we’ll show you how to display the IP information from a visitor’s IP using Symfony 4 platform and IP2Location BIN database. This demo is only supported for Symfony 4. Tutorial on the Symfony implementation.Ĭopyright (C) 2005-2021 by IP2Location.Geolocation Lookup Using Symfony 4 and IP2Location BIN Database
Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.īelow are the list of other framework library that you can install and use right away.Use the IPv4 BIN file if you just need to query IPv4 addresses.You can also sign up for IP2Location Web Service to lookup by IP2Location API. 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.
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.
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. 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.īelow is the description of the functions available in the Country class.
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'
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.
Monthly update is available for both IP2Location LITE and commercial database. Commercial database is availabe at (Comprehensive with high accuracy).LITE database is available at (Free with limited accuracy).prevent password sharing and abuse of serviceįree IP2Location LITE and commerical databases are available for download.analyze your web server logs to determine the countries of your visitors.select the geographically closest mirror.This module can be used in many types of projects such as: This module uses a file based database available at.
This PHP module provides fast lookup of country, region, 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 and IAB category from IP address by using IP2Location database. This is the official release maintained by