- file_get_contents: documentation ( source)
- header: documentation ( source)
- simplexml_load_file: documentation ( source)
<?php
header('Content-type: application/xml');
echo file_get_contents('http://cloud.tfl.gov.uk/TrackerNet/PredictionSummary/V');
$xml = simplexml_load_file('http://cloud.tfl.gov.uk/TrackerNet/PredictionSummary/V'); //retrieve URL and parse XML content
echo $xml->getName(); // output name of root element