Home > Backend Development > PHP Tutorial > 从一个ip地址中,你可以得到什么解决思路

从一个ip地址中,你可以得到什么解决思路

WBOY
Release: 2016-06-13 13:46:05
Original
930 people have browsed it

从一个ip地址中,你可以得到什么
如题,比如说是所在地址,通过任何方法(注明方法)得到的,都可以……

------解决方案--------------------
gethostbyaddr($ip) 可以获得主机的域名。
要得到地址,你得有ip与地址对应的库,类似腾讯的那种。
------解决方案--------------------
其实sina的ip库比腾讯的更好

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=xml

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=8.8.8.8

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template