1  public function test()
2     {
3         $request = Request::instance();
4         $ip = $request->ip();
5         $url='http://ip.taobao.com/service/getIpInfo.php?ip='.$ip;
6         $result = file_get_contents($url);
7         $result = json_decode($result,true);
8         dump($result);
9     }

 

 tp5 通过IP获取对应ip的城市

 

相关文章:

  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2021-08-17
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案