PHP/String/curl init
Fetching a URL with cURL
<?php
$c = curl_init("http://www.example.ru/robots.txt");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($c);
curl_close($c);
?>
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.ru/files.html");
curl_setopt($c, CURLOPT_FILE, $fh);
curl_exec($c);
curl_close($c);
?>