How can I read the enclosure url tag in a iTunes RSS using simplexml ?
FEED:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<item>
<itunes:subtitle> subtitle </itunes:subtitle>
<enclosure url="http://www.myWe/mySound.mp3" length="624557" type="audio/mp3"/>
</item>
</channel>
</rss>
PHP:
foreach ($feed->channel->item as $item) {
$iTunes_item = $item->children('http://www.itunes.com/dtds/podcast-1.0.dtd');
$item_subtitle = $item->subtitle->attributes();
$item_url = $iTunes_item->enclosure->attributes('url'); // enclosure url
echo $item_subtitle;
echo $item_url;
}