Plot XML API result



I am trying to print the results of this XML API call, but get a parse error on line 4:



syntax error, unexpected '->' (T_OBJECT_OPERATOR)




<?php
if( $xml = simplexml_load_file("http://ift.tt/1DXk0tG"))
{
foreach($xml->avg-dni->monthly as $detail)
{
$jan = $detail->jan;
$feb = $detail->feb;
echo "$detail->";
}
}
?>

No comments:

Post a Comment