PHP code example of getsky / airac
1. Go to this page and download the library: Download getsky/airac library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
getsky / airac example snippets
use GetSky\AIRAC\AiracProducer;
$producer = new AiracProducer();
$nowAirac = $producer->now(new DateTime('2018-04-05'));
// or
$nowAirac = $producer->nowByNumber('1804');
// return Airac with dateStart 2018-03-29 and number 1804
$nextAirac = $producer->next(new DateTime('2018-01-10'));
// or
$nextAirac = $producer->nextByNumber('1801');
// or
$airac = $producer->now(new DateTime('2018-01-10'));
$nextAirac = $producer->nextByAirac($airac);
// return Airac with dateStart 2018-02-01 and number 1802
$lastAirac = $producer->last(new DateTime('2018-01-10'));
// or
$lastAirac = $producer->lastByNumber('1801');
// or
$airac = $producer->now(new DateTime('2018-01-10'));
$nextAirac = $producer->lastByAirac($airac);
// return Airac with dateStart 2017-12-07 and number 1713
use GetSky\AIRAC\AiracProducer;
$producer = new AiracProducer(new DateTime('2015-01-22')); // now cycle shifted by 14 days