$txt="
http://example.com/common/img/fe/form/main-680-white-important.gif
http://examplecom/common/img/fe/form/main-680-white-checkout-back-link.gif
http://example.com/common/img/fe/form/main-680-white-checkout-cart-link.gif
";
$a1=explode("\n",$txt);
$a1=array_unique($a1);
foreach($a1 as $url) {
$ch = curl_init($url); // инициализация
$path_parts = pathinfo($url); //получаем название файла из URL
// сохраняем полученный файл с его оригинальным названием
$fp = fopen('images/'.$path_parts['basename'], 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
echo "$it<br>";
}