Skip to content

Instantly share code, notes, and snippets.

@steveathon
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveathon/7c53ff0ee134b261e2e2 to your computer and use it in GitHub Desktop.
Save steveathon/7c53ff0ee134b261e2e2 to your computer and use it in GitHub Desktop.
MOT Bus Stop Codes
<?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