Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Add Airports API to exploring data example
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Gerrand committed Apr 28, 2022
1 parent ed3e1c4 commit c11ee72
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/exploring-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,17 @@

echo sprintf("Airline's IATA code is %s\n", $airline['iata_code']);

echo "Loading airports...\n";

$airports = $client->airports()->all();

echo sprintf("Got %d airports\n", count($airports));

echo sprintf("Found airport %s %s\n", $airports[0]['name'], $airports[0]['iata_code']);

$airport = $client->airports()->show($airports[0]['id']);

echo sprintf("Airport is located at %s, %s\n", $airport['latitude'], $airport['longitude']);

$finish = time();
echo sprintf("Finished in %d seconds.\n", ($finish - $start));

0 comments on commit c11ee72

Please sign in to comment.