<?php

$pnr = "6806833406"; // Replace with the actual PNR number

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://i...content-available-to-author-only...i.com/api/v3/getPNRStatus?pnr=" . $pnr,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: irctc1.p.rapidapi.com",
        "x-rapidapi-key: d6ef3b3db3msh856dff3477628a7p1aa4fdjsn4942b886b20f"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    print_r(json_decode($response, true)); // Decoding JSON for a readable array
}
