SimplePie 1.3.1 is now available. Upgrade now!

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/05 19:56 (external edit)