Hace tiempo escribi esta funcion que hacia lo que estas pidiendo:
Código PHP:
function save_img($image) {
$img_file = file_get_contents($image);
$image_path = parse_url($image);
$img_path_parts = pathinfo($image_path['path']);
$filename = $img_path_parts['filename']
$img_ext = $img_path_parts['extension'];
$path = "img/";
$filex = $path . $filename . "." .$img_ext;
$fh = fopen($filex, 'w');
fputs($fh, $img_file);
fclose($fh);
return filesize($filex);
}
Asegurate que el " $path = "img/"; " existe en el servidor y que se escribible por el process de httpd
Si quieres usarlo puedes llamarlo de esta forma
Código PHP:
save_img("http://www.prueba.com/imagen.jpg")
Saludos