How can I access the views of the newest Entry in this XML file?
https://www.youtube.com/feeds/videos.xml?channel_id=UCeNdjxcrWI5B1-j8mG4Nm7g
That is my attempted, but it's not working:
$xml = simplexml_load_file(sprintf('https://www.youtube.com/feeds/videos.xml?channel_id=%s', $channel_id)); foreach ($xml->entry as $entry) { if (!empty($entry->children('yt', true)->videoId[0])){ $views = $entry->children('group')->children('community')->statistics['views']; echo $views;}}