Last active
August 29, 2015 14:02
-
-
Save steveathon/7c53ff0ee134b261e2e2 to your computer and use it in GitHub Desktop.
MOT Bus Stop Codes
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 | |
// Heres the transport grab of Bus Stops in SG | |
// Built for the YRS'rs in Sing. | |
$Url = "http://datamall.mytransport.sg/ltaodataservice.svc/BusStopCodeSet?"; | |
$ch = curl_init(); | |
$headerOptions = array ( | |
'accept', "*/*", | |
'AccountKey', 'accountKey', | |
'UniqueUserID', 'uniqueID' | |
); | |
$options = array ( CURLOPT_HTTPHEADER=>$headerOptions, | |
CURLOPT_URL=>$Url); | |
$optionsSet = curl_setopt_array($ch,$options); | |
// XML as a variable | |
$output = @curl_exec($ch); | |
// Print it to the screen | |
print_r($output); | |
$OurXML = simplexml_load_string($output); | |
print_r($OurXML); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment