2016-06-11 68 views
0
<?php[![enter image description here][1]][1] 
    $try = simplexml_load_file("https://www.theguardian.com/football/series/footballweekly/podcast.xml") ; 
    echo "<pre>" ; 
    print_r($try) ; 
    echo "</pre>" ; 

然后我尝试echo $try->language$try->item[0]->titel。没有显示,所以我如何访问这个对象?如何在php中读取simpleXML对象?

回答

0

您错过了XML的一个级别:

$try->channel->language 
$try->channel->item[0]->title