<?php
function curl_get_contents($url) {
// Initiate the curl session
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
// Removes the headers from the output
curl_setopt($ch, CURLOPT_HEADER, 0);
// Return the output instead of displaying it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute the curl session
$output = curl_exec($ch);
// Close the curl session
curl_close($ch);
// Return the output as a variable
return $output;
}
?>This function is just like file_get_contents. To use it, use the following piece of code:<?php
$output = curl_get_contents('http://www.example.com/');
echo $output;
?>http://www.fusionswift.com/posts/2010/02/curl-vs-file_get_contents/
http://stackoverflow.com/questions/555523/file-get-contents-vs-curl-what-has-better-performance
http://www.php.net/manual/en/wrappers.php.php
Interesting one. Keep posting such kind of information on your blog. I bookmarked it for continuous visit.
ReplyDeletehtml5 player| html5 video player
thank you :)
Delete