本文介绍了将IP地址与国家相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想根据我在服务器端收到的IP地址显示国旗。
固定IP地址是否分配给国家?在哪里可以获得数据库的IP地址到国家/地区的映射?
解决方案
请看下面的内容:
$ b
- / app / geoip_countryrel =nofollow noreferrer> MaxM ind - 开放源IP地址到国家/地区数据库
-
另请参阅堆栈溢出:
一旦你有国家代码,那么你可以显示与这些免费图标使用ISO国家/地区代码的设置:
PHP Advent也发布了一篇关于非常相似的过程的文章:
I want to show country flag depending on ip address I receive at server side.Are fixed ip addresses are assigned to countries ? Where can I get database for ip address to country mapping ?
解决方案
Take a look at the following:
- IP address geolocation SQL database
- Geo Locate IP Address XML API Whois Map Country Provider
- How to Geolocate Visitors Using an IP-to-Country Database
- Free IP to Country Database
- My IP Address Lookup and Geotarget IP Project
- MaxMind - Open Source IP Address to Country Database
- IP address geolocation SQL database
Also on Stack Overflow:
- What is the most applicable solution to detect which country an ip belongs to?
- Is there any possible way to find the name of the country using IP with scripting language PHP?
- IP to Country?
- code for finding the state,country,city from the IP Adress in php
Once you have the country code, then you can display the flag with these free icon sets which use ISO country codes:
PHP Advent also just published a whole article on a very similar process:
这篇关于将IP地址与国家相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!