Created
August 20, 2011 12:43
-
-
Save holydevil/1159060 to your computer and use it in GitHub Desktop.
Get PNR status using Alagu's API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(1); | |
//$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259?jsonp=parseJSON"; | |
$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259"; | |
$ch = curl_init($url); | |
//curl_setopt($ch, CURLOPT_HEADER, TRUE); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
$out_arr = json_decode($output); | |
//var_dump($output); | |
echo "<pre>"; | |
print_r($out_arr); | |
echo "</pre>"; | |
echo "example " . $out_arr->status; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there any way we can get the pnr status data from https://pnrstatus.com or https://railenquiry.in in json format ?
railenquiry send and receives request by ajax but they have a strong ip blocking system, is there any other way ? The above code is also not working.