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

force_fsockopen()

Description

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

If cURL is available, SimplePie will use it instead of the built-in fsockopen functions for fetching remote feeds. This config option will force SimplePie to use fsockopen even if cURL is installed.

Availability

  • Available since SimplePie Beta 3.

Parameters

enable

Enable/disable forced fsockopen usage.

Examples

Use fsockopen instead of cURL functions

$feed = new SimplePie();
$feed->set_feed_url('http://simplepie.org/blog/feed/');
$feed->force_fsockopen(true);
$feed->init();
$feed->handle_content_type();
echo $feed->get_title();

See Also


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