承接 djonepl/ipapi-co-php 相关项目开发

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

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

djonepl/ipapi-co-php

最新稳定版本:1.0.1

Composer 安装命令:

composer require djonepl/ipapi-co-php

包简介

A simple API for ip-api.com using PHP

README 文档

README

A simple API for ipapi.co using PHP

Installation

Just require the package using composer.

composer require djonepl/ipapi-co-php

Using the package

Just import, instantiate and call:

<?php

use IpApi\IpApi;

$api = new IpApi('APIKEY');
$location = $api->lookup('IP');

The \IpApi\Location object

The location object has an schema returned composed by the following fields by default:

ip network version city region region_code country country_name country_code country_code_iso3 country_capital country_tld continent_code in_eu postal latitude longitude timezone utc_offset country_calling_code currency currency_name languages country_area country_population asn org

The location object has some others methods and features:

$location = $api->lookup('8.8.8.8');

// Convert the object to an array
$data = $location->toArray();

// Extract city and ASN 
echo $location->city; // Mountain View
echo $location->asn; // AS15169

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-12