SimplePie 1.5 is now available!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie » get_channel_tags()



class SimplePie {
	get_channel_tags ( string $namespace, string $tag )

This method allows you to get access to ANY element/attribute in the channel/header section of the feed. It will return an array, which you should look at with PHP's print_r() function.

:!: Note that this will return an array of all of the elements it finds, and you can only go deeper – not shallower.


  • Available since SimplePie 1.0.


namespace (required)

The URL of the XML namespace of the elements you're trying to access. SimplePie has a number of constants for supported namespaces in our Supported XML Namespaces document. If we don't have a constant for it, you can manually add the namespace URL as listed inside the feed.

tag (required)

This is the tag (element) that you want to get.


Grab the contents of a custom element

$feed = new SimplePie();
$success = $feed->init();
if ($success)
	$opensearch = $feed->get_channel_tags('', 'itemsPerPage');
	echo $opensearch[0]['data'];
	echo $feed->error();

See Also

reference/simplepie/get_channel_tags.txt · Last modified: 2011/03/06 03:56 (external edit)