package for detecting users contry in php? [closed]
Question
I want to know what is the best package to detect country which user is visiting from?
I am using php/mysql..
Solution
I think there is not a guaranteed way but there are some options:
- You can use GeoIP
- You can check the
HTTP_ACCEPT_LANGUAGE
header($_SERVER
) - Use any IP-To-Country database
OTHER TIPS
You can download the MaxMind GeoLite Country database, and use that to lookup the IP of user to determine their country.
There are paid versions of that database, but I've found the accuracy of the free database more than sufficient.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow