I need to save an image from a PHP URL to my PC.
Let\'s say I have a page, http://example.com/image.php
, holding a single \"flower\" image, nothing else. How ca
Here you go, the example saves the remote image to image.jpg.
function save_image($inPath,$outPath)
{ //Download images from remote server
$in= fopen($inPath, "rb");
$out= fopen($outPath, "wb");
while ($chunk = fread($in,8192))
{
fwrite($out, $chunk, 8192);
}
fclose($in);
fclose($out);
}
save_image('http://www.someimagesite.com/img.jpg','image.jpg');