Aviationstack API

Bởi Viet-Tran

$queryString = http_build_query([ ‘access_key’ => ‘4ca725b8bf3eb1b00069d56086578a21’ ]); $ch = curl_init(sprintf(‘%s?%s’, ‘https://api.aviationstack.com/v1/flights’, $queryString)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $json = curl_exec($ch); curl_close($ch); $api_result = json_decode($json, true); foreach ($api_result[‘results’] as $flight) { if (!$flight[‘live’][‘is_ground’]) { echo sprintf(“%s flight %s…