承接 steefdw/airports 相关项目开发

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

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

steefdw/airports

最新稳定版本:v0.1.1

Composer 安装命令:

composer require steefdw/airports

包简介

Airports

README 文档

README

Inspired by CGP Grey's video: ✈️ The Maddening Mess of Airport Codes! ✈️

Installation

composer require steefdw/airports

Usage

Get an airport by its IATA code:

$amsterdam = Airports::getAirport('AMS');
// Steefdw\Airports\Airport^ {
//   +icao: "EHAM"
//   +iata: "AMS"
//   +name: "Amsterdam Airport Schiphol"
//   +city: "Amsterdam"
//   +state: "North-Holland"
//   +country: "NL"
//   +elevation: -11
//   +lat: 52.3086013794
//   +lon: 4.7638897896
//   +timezone: "Europe/Amsterdam"
// }

Get the distance between two airports:

$amsterdam = Airports::getAirport('AMS');
$barcelona = Airports::getAirport('BCN');

$distance = $amsterdam->getDistance($barcelona); // 1241.0765638345 (km)

Get the time difference between two airports:

$amsterdam = Airports::getAirport('AMS');
$london = Airports::getAirport('LTN');

$timeDiff = $amsterdam->getTimeDiff($london); // -1 (hour)

Get an array of airports:

Airports::getAirports(); // get all ~29k airports in the world
Airports::getIataAirports(); // only the 7780 airports that have a three-letter IATA code.
Airports::getAirportsByCountryCode('nl'); // only get the 27 airports in the Netherlands

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-27