download a web page to a file

download a web page to a file using cURL

<?php

$site = curl_init (“http://www.google.com/”);
$fp = fopen (“google.txt”, “w”);

curl_setopt ($site, CURLOPT_FILE, $fp);
curl_setopt ($site, CURLOPT_HEADER, 0);

curl_exec ($site);
curl_close ($site);
fclose ($fp);
?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*