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



class SimplePie {
	force_feed ( [bool $enable = false] )

RSS and Atom feeds are supposed to have certain mime types associated with them so that software knows what type of data it is. Some feeds don't follow these rules, and serve feeds with invalid mime types (e.g. text/plain). SimplePie follows best practices by default, but you can override this behavior with this option.


  • Available since SimplePie 1.1.



Enable/disable forcing the data to be handled as a feed.


Force SimplePie to handle a text/plain document as a feed

$feed = new SimplePie();
echo $feed->get_title();

:!: Note: Whereas YouTube feeds used to be served as text/plain, we notified them of the issue and they have since changed the mime type to application/rss+xml.

See Also

reference/simplepie/force_feed.txt · Last modified: 2011/03/05 19:56 (external edit)