2016-06-11 95 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