I Google’d not long ago and came across this solution to loop out information from a XML page.
$url = 'http://steamcommunity.com/id/ChetFaliszek/stats/L4D/?xml=1';
$achxml = simplexml_load_file($url);
foreach ($achxml->playerstats->game as $ach)
{
$name = (string) $ach->NAME;
echo $name. "<br>";
}
I think these lines of code will do the trick but I only get following error when I try to fetch the information: Warning: Invalid argument supplied for foreach() in .... The link to the XML page (random guys XML) is in the $url parameter.
Now to the question: How do I fix this problem so I can see if this code will work?
Thanks in advance.
try: