定制 tenfef/ipfind-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tenfef/ipfind-php

最新稳定版本:1.0.1

Composer 安装命令:

composer require tenfef/ipfind-php

包简介

PHP Library to fetch location information from an IP Address

README 文档

README

A simple class for getting a users location from their IP Address. The class uses IP Find - IP Geolocation API as the backend API for this service.

Installation

Install the latest version with

$ composer require tenfef/ipfind-php

Basic Usage

<?php

use Tenfef\IPFind\IPFind;

$apiKey = "YOUR_API_KEY_HERE"; // get an API key from https://ipfind.co or pass in NULL if you plan on using < 100/day
$ipfind = new IPFind($apiKey);
$result = $ipfind->fetchIPAddress('8.8.8.8');
var_dump($result);

/*
object(stdClass)#2 (14) {
  ["ip_address"]=>
  string(7) "8.8.8.8"
  ["country"]=>
  string(13) "United States"
  ["country_code"]=>
  string(2) "US"
  ["continent"]=>
  string(13) "North America"
  ["continent_code"]=>
  string(2) "NA"
  ["city"]=>
  string(13) "Mountain View"
  ["county"]=>
  string(11) "Santa Clara/
  ["region"]=>
  string(10) "California"
  ["region_code"]=>
  string(2) "CA"
  ["timezone"]=>
  string(3) "PST"
  ["owner"]=>
  string(26) "LEVEL 3 COMMUNICATIONS INC"
  ["longitude"]=>
  float(-122.0865)
  ["latitude"]=>
  float(37.3801)
  ["warning"]=>
  string(131) "You are not using an IP Find API Key. You are limited to 100 requests/day. Register for free at https://ipfind.co for higher limits"
}
*/

Documentation

License

IP Find is licensed under the MIT License

统计信息

  • 总下载量: 307
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-05