$array = explode(',', $resimler);
function curl_get($url)
{
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();
$timeout = 0;
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);
$xml = curl_exec($ch);
curl_close($ch);
return $xml;
}
function curl_download($url, $file)
{
$handle = fopen($file, 'wb');
fwrite($handle, curl_get($url));
fclose($handle);
return TRUE;
}
foreach($array as $image)
{
$image = explode('/', trim($image));
$filename = end($image);
curl_download($image, './wp-content/uploads/images/' . $filename);
}deneme imkanım olmadığı gibi umarım hata çıkartmaz, en baştaki $resimler sizin virgüllü metniniz olacak. resim1.jpg, resim2.jpg gibi...