SimplePie::get_feed_tags
Get data for an feed-level element
This method allows you to get access to ANY element/attribute that is a sub-element of the opening feed tag. The return value is an indexed array of elements matching the given namespace and tag name. Each element has `attribs`, `data` and `child` subkeys. For `attribs` and `child`, these contain namespace subkeys. `attribs` then has one level of associative name => value data (where `value` is a string) after the namespace. `child` has tag-indexed keys after the namespace, each member of which is an indexed array matching this same format. For example: <pre> // This is probably a bad example because we already support // <media:content> natively, but it shows you how to parse through // the nodes. $group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group'); $content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']; $file = $content[0]['attribs']['']['url']; echo $file; </pre>
Signature
public function get_feed_tags(string
$namespace,
string
$tag )
Parameters
$namespace
— string- The URL of the XML namespace of the elements you're trying to access
$tag
— string- Tag name
Returns
- array