- print_r: documentation ( source)
- simplexml_load_file: documentation ( source)
<?php
$mainurl = "http://www.xmlsoccer.com/FootballDataDemo.asmx/";
$method = "GetAllTeamsByLeagueAndSeason";
$apikey = "GMUIGPJPDSGYEKACQPVPQMPMBQVZUEHNHJFJTVVISPDOXYOOEG";
$league = "Scottish+Premiere+league";
$season = "1314";
$endurl = $mainurl . $method . "?Apikey=" . $apikey . "&league=" . $league . "&seasonDateString=" . $season;
$xml = simplexml_load_file($endurl);
print_r($endurl);
//print_r($xml);
foreach($xml->Team as $team) {
echo $team->name;
}