PHP Classes

PHP Flight Schedules: Get real time flight schedules using aviationStack

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 184 All time: 8,665 This week: 84Up
Version License PHP version Categories
aviationstack 1.0.0GNU General Publi...5PHP 5, Web services, Geography
Description 

Author

This package can be used to get real time flight schedules using aviationStack API.

It can send HTTP requests to the Web server of the aviationStack API to retrieve several types of information about flight schedules. Currently it can:

- Get real time flight schedules for all major airports worldwide. Schedule information includes whether flight is on-time, delayed or cancelled.
- Get airline routes
- Get data about global airports
- Get data about global airlines
- Get data about different airplanes and aircrafts
- Get data about different aircraft types
- Get data about aviation taxes
- Look up destination cities
- Look up destination countries

Innovation Award
PHP Programming Innovation award nominee
February 2020
Number 5
Many sites that work on the travelling business and related areas of activity need to know about information related with flights of companies that take passengers to many destinations around the world.

This package provides a PHP solution to get many types of details about flights, airports, schedules, airplanes, etc.. that can be useful for many sorts of travelling businesses.

Manuel Lemos
Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 59
All time rank: 608 in United States United States
Week rank: 16 Up2 in United States United States Up
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Example

<?php
/*
example usage
aviationStack ver 1.0

You must get an API key from https://aviationstack.com/product
and enter it in the aviationstack.class.php file

For complete documentation on each endpoint and available paramaters
see https://aviationstack.com/documentation
*/

//turning off low level notices
error_reporting(E_ALL ^ E_NOTICE);

//instantiate the class
include('aviationstack.class.php');
$aviation = new aviationStack();

//set the end point to use
$aviation->setEndPoint('flights');

//set the parameters
//in this example, we are getting all flights departing from San Francisco
//and arriving in Dallas/Fort Worth
$aviation->setParam('flight_date','2019-12-30');
$aviation->setParam('dep_iata','SFO');
$aviation->setParam('arr_iata','DFW');

//show request
echo $aviation->buildRequest().'<br>';

//get the response
$aviation->getResponse();

//check for errors
if( !empty($aviation->errorCode) ){
   
//error returned
   
echo $aviation->errorCode.': '.$aviation->errorText;
}

//displaying the full response
echo '<pre>';
var_dump($aviation->response);
echo
'<pre>';
?>


  Files folder image Files  
File Role Description
Plain text file aviationstack.class.php Class Main Class
Accessible without login Plain text file example.php Example Example Usage
Accessible without login Plain text file license.txt Lic. License

 Version Control Unique User Downloads Download Rankings  
 0%
Total:184
This week:0
All time:8,665
This week:84Up