fork download
  1. <?php
  2.  
  3. $pnr = "6806833406"; // Replace with the actual PNR number
  4.  
  5. $curl = curl_init();
  6.  
  7. CURLOPT_URL => "https://i...content-available-to-author-only...i.com/api/v3/getPNRStatus?pnr=" . $pnr,
  8. CURLOPT_RETURNTRANSFER => true,
  9. CURLOPT_ENCODING => "",
  10. CURLOPT_MAXREDIRS => 10,
  11. CURLOPT_TIMEOUT => 30,
  12. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13. CURLOPT_CUSTOMREQUEST => "GET",
  14. CURLOPT_HTTPHEADER => [
  15. "x-rapidapi-host: irctc1.p.rapidapi.com",
  16. "x-rapidapi-key: d6ef3b3db3msh856dff3477628a7p1aa4fdjsn4942b886b20f"
  17. ],
  18. ]);
  19.  
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22.  
  23. curl_close($curl);
  24.  
  25. if ($err) {
  26. echo "cURL Error #:" . $err;
  27. } else {
  28. print_r(json_decode($response, true)); // Decoding JSON for a readable array
  29. }
  30.  
Success #stdin #stdout 0.03s 26324KB
stdin
Standard input is empty
stdout
cURL Error #:Could not resolve host: irctc1.p.rapidapi.com