我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

通过他的IP获取用户的地址详细信息? [重复]

This question already has an answer here:

  • Getting the location from an IP address 24 answers

I found many results, but i didn't get any solution for Ip's. I want to find the user ip details all over the world by using php, but not able to find it.

</div>

You can use this:

$ip is user's ip address.

$ip = $_SERVER['REMOTE_ADDR'];
    $data = file_get_contents("http://www.geoplugin.net/json.gp?ip=". $ip);
    $data = json_decode($data);

echo $data->geoplugin_countryName; // and so on

近期文章

  • Parent的类构造函数调用错误?
  • PHP,MVC,404 - 如何重定向到404?
  • 在Laravel 5中合并'with'和'whereHas'
  • 如何制作安全登录页面(https)
  • 使用rawQuery搜索数据库表
  • 从PHP填充Selectize Dropdown
  • apache + php-fpm随机403错误
  • 如何从PHP页面删除[重复]
  • 清除二维会话数组
  • OnePress wp主题:关于团队部分
  • TYPO3如何扩展HTML主要布局
  • 如何使用php isset一个函数?
  • 控制$ _POST中出现的变量
  • terroexplorer可以导入的3d.x格式最大支持单个文件为多大,我的模型较大,导入之后不显示
  • [Android]Service里面发送广播消息出现问题[内有代码]
  • 使用for循环向mysql输入数据
  • 使用switch元素更新DB值
  • PHP代码在firefox中没有结果?
  • 在HTML选择中选择选项
  • PHP中的邮政编码邻近度计算

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华