How to get country name from an IP address using PHP without using a commercial GeoIP Region Edition?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think you can do it simply using PHP, but I have found a free API solution that you can use. It requires simple post and response.
http://www.hostip.info/use.html
example post:
http://api.hostip.info/get_html.php?ip=12.215.42.19
example response:
Country: UNITED STATES (US)
City: Sugar Grove, IL