PHP淘宝IP数据获取用户IP及地理位置
在直接在ie浏览器中打开下面地址
http://ip.taobao.com/service/getIpInfo.php?ip=8.8.8.8
返回信息
代码如下 | 复制代码 |
{"code":0,"data":{"country":"u7f8eu56fd","country_id":"US","area":"","area_id":"","region":"","region_id":"","city":"","city_id":"","county":"","county_id":"","isp":"","isp_id":"","ip":"8.8.8.8"}} |
上面我们是直接在ie地址输入,这里我们利用php file_get_contents函数来获取
代码如下 | 复制代码 |
/** |
上面原因是通过file_get_contents由淘宝网返回的json格式的数据,我们再利用php json_decode函数转换成数组。
$IP地址需要我们提供,下面提供一个获取用户真实IP地址的函数
代码如下 | 复制代码 |
|
永久链接:
转载随意!带上文章地址吧。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
