Copy link to clipboard
Copied
Hi, I'm on multi language website and I need to set the language session by the user country.
It is possible ?
You can use GeoIP PECL extension of PHP:
http://jp2.php.net/geoip
It uses MaxMind's free GeoLite database which is over 99% accurate:
http://www.maxmind.com/app/geolitecountry
Copy link to clipboard
Copied
Do a Google on IP addresses. You will find references to databases that will translate IP addresses into locations, city/country/latitude/longitude/postal code/area code. Some are free, others charge a fee. Accuracy is variable, with the more you pay the better the results. Some rates varied with the number of lookups/month.
At least one database offers tables that can be downloaded for free and then uploaded into your own database. Remember, though, you will be dealing with tables that contain roughly 4 million records. Not to mention the need to check of updates regularly for newly defined IP block assignments.
Copy link to clipboard
Copied
You can use GeoIP PECL extension of PHP:
http://jp2.php.net/geoip
It uses MaxMind's free GeoLite database which is over 99% accurate:
http://www.maxmind.com/app/geolitecountry
Copy link to clipboard
Copied
Thankyou very much !!!