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 » set_url_replacements()

set_url_replacements()

Description

class SimplePie {
	set_url_replacements ( [array $element_attribute = array('blockquote' => 'cite', 'ins' => 'cite', 'del' => 'cite', 'a' => 'href', 'q' => 'cite', 'img' => 'src', 'img' => 'longdesc', 'area' => 'href', 'form' => 'action', 'input' => 'src')] )
}

Set element/attribute key/value pairs of HTML attributes containing URLs that need to be resolved relative to the feed.

Availability

  • Available since SimplePie 1.0.

Parameters

element_attribute

Element/attribute key/value pairs.

Examples

Limit the URL fixing to only links and images.

$feed = new SimplePie();
$feed->set_feed_url('http://simplepie.org/blog/feed/');
$feed->set_url_replacements(array('a' => 'href', 'img' => 'src'));
$feed->init();
$feed->handle_content_type();
echo $feed->get_title();

See Also


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