Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. public static function getAirport($code)
  2.     {
  3.         if (!empty($code)) {
  4.             $code = strtolower($code);
  5.  
  6.             $airports = require(__DIR__ . '/AirportsDb.php');
  7.  
  8.             foreach ($airports as $airport) {
  9.                 if ($code == strtolower($airport['Code'])) {
  10.                     return $airport;
  11.                 }
  12.             }
  13.         }
  14.  
  15.         return false;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement