thinkphp根据ip获取所在地getlocation()

时间:2019-01-06 05:19:13
【文件属性】:
文件名称:thinkphp根据ip获取所在地getlocation()
文件大小:4.67MB
文件格式:ZIP
更新时间:2019-01-06 05:19:13
UTFWry.dat 在我们使用thinkphp类库IpLocation方法getLocation时,发现获取到信息为空,原因是在我们的框架中没有加载地址库UTFWry.dat,可以在构造方法中看到__construct($filename = "UTFWry.dat"),再次我们只需要下载文件,解压后得到UTFWry.dat,把文件放在 $this->fp = fopen(dirname(__FILE__).'/'.$filename, 'rb')) 对应地址 ThinkPHP\Library\Org\Net/UTFWry.dat中 然后getlocation(ip地址)方法就可以获取到地址了
【文件预览】:
UTFWry.dat

网友评论

  • 还行,可以用,谢谢
  • 谢谢分享!