承接 chrisullyott/php-ip-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

chrisullyott/php-ip-api

Composer 安装命令:

composer require chrisullyott/php-ip-api

包简介

A PHP wrapper for ip-api.com.

README 文档

README

Latest Stable Version Total Downloads

PHP IP API

Fetch geolocation data for IP addresses from ip-api.com.

Installation

$ composer require chrisullyott/php-ip-api

Instantiation

$api = new ChrisUllyott\IpApi();

// Set output language and fields (optional)
$api->setLanguage('en');
$api->setFields(['query', 'country', 'city']);

Request one

$response = $api->get('91.198.174.192');
print_r($response);
stdClass Object
(
    [country] => Netherlands
    [city] => Amsterdam
    [query] => 91.198.174.192
)

Request many

$ips = [
    '100.142.29.254',
    '100.142.39.218'
];

$response = $api->get($ips);
print_r($response);
Array
(
    [0] => stdClass Object
        (
            [country] => United States
            [city] => Chicago
            [query] => 100.142.29.254
        )

    [1] => stdClass Object
        (
            [country] => United States
            [city] => Chicago
            [query] => 100.142.39.218
        )
)

Request from a file (create CSV)

Using a newline-separated list of IP addresses, a CSV file of response data will be built.

$file = 'ips.txt';

$list = new ChrisUllyott\IpApiList($file);
$list->setFields(['query', 'country', 'city']);
$list->build();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固