fork download
  1. <?php
  2.  
  3. $url = 'https://a...content-available-to-author-only...e.com/search/plans?fromICAO=EHAM&toName=Kennedy&limit=1';
  4. $curl = curl_init($url);
  5. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  6. if($response = curl_exec( $curl ))
  7. {
  8. if( curl_getinfo( $curl, CURLINFO_HTTP_CODE ) == '200' )
  9. {
  10. $json = json_decode($response, TRUE, JSON_PRETTY_PRINT);
  11.  
  12. echo $json[0]['id'];
  13. }
  14. else
  15. {
  16. $curl_info = curl_getinfo( $curl );
  17. }
  18. }
  19. else
  20. {
  21. echo 'Error';
  22. }
  23. curl_close($curl);
  24.  
  25. ?>
  26.  
  27. // your code goes here
Success #stdin #stdout 0.03s 26160KB
stdin
Standard input is empty
stdout
Error
// your code goes here