Here is another, somewhat easier to follow, example, straight from the site I commented
$remote_img = 'http://www.somwhere.com/images/image.jpg';
$img = imagecreatefromjpeg($remote_img);
$path = 'images/';
imagejpeg($img, $path);
http://www.edmondscommerce.co.uk/php/php-save-images-using-curl/