<?php
$url = 'http://compolom.ru/222.jpg';
$path = '222.jpg';
$ch = curl_init();
$fp = fopen($path, "w+");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
CURLOPT_FAILONERROR, false);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,
60);
curl_setopt($ch,
CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER,
false);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>