cURL is a great tool to
help you connect to remote web sites, making it easy to post forms, retrieve
web pages, or even to download files (e.g if you want to use a
web-based API, provided by service like TinyURL, Digg, Twitter) ,actually it is very simple and
faster to use than other methods of downloading .
The simplest code of a PHP function
to retrieve file’s contents using PHP’s CURL is below:
function
getfile($url)
{
//
More great PHP snippets at http://www.scriptime.blogspot.in
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$downloaded = curl_exec($ch);
curl_close($ch);
return $downloaded;
}
try this code :-
|
1 comments:
çankırı
tekirdağ
giresun
manisa
BR4
Post a Comment