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_links()

get_links()

Description

class SimplePie {
	get_links ( [$rel = 'alternate'] )
}

Returns an array of links that were found for the feed which can be looped through.

Availability

  • Available since SimplePie Beta 2.

Parameters

relation

The relationship of links to return.

Examples

Loop through each item and do something with each

<?php
require_once('../simplepie.inc');
 
$feed = new SimplePie('http://simplepie.org/blog/feed/');
$feed->handle_content_type();
 
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>Sample SimplePie Page</title>
</head>
<body>
 
<?php
foreach ($feed->get_items() as $item)
{
	foreach ($item->get_links() as $link)
	{
		echo $link . "<br />";
	}
}
?>
</body>
</html>

See Also


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