Writing a response body to a file with cURL : curl_init « String « PHP






Writing a response body to a file with cURL

 
<?php
$fh = fopen('local-copy-of-files.html','w') or die($php_errormsg);
$c = curl_init('http://www.example.com/files.html');
curl_setopt($c, CURLOPT_FILE, $fh);
curl_exec($c);
curl_close($c);
?>
  
  








Related examples in the same category

1.Fetching a URL with cURL