Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

PHP Fetching URL Content With load() Function

Share this post!
 Vote this!

PHP make this very easy by including functions like file_get_contents() that has URL support. This code will get you the contents of an URL.
$contents = file_get_contents('http://example.com/rss.xml');
Unfortunately, this is a huge security threat - and many servers have disabled this feature in PHP. Also this is not the most optimized method to fetch an URL. Also, it is impossible to submit data using the POST method using this function.

PHP provide two method to fetch an URL - Curl and Fsockopen. But to use this we have to write a lot more code.

load()

So I decided to create my own function that makes it much more easier.  more...

0 comments:

Post a Comment