lee carter lee carter - 5 months ago 11
PHP Question

how do i read the simpleXML Object in php?

PHP

<?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>" ;


Than I try to
echo $try->language
or
$try->item[0]->titel
nothing show so how can i access this object.

Answer

You're missing out one level of XML:

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