回答:
にallow_url_fopen設定した場合true:
$url = 'http://example.com/image.php';
$img = '/my/folder/flower.gif';
file_put_contents($img, file_get_contents($url));
$ch = curl_init('http://example.com/image.php');
$fp = fopen('/my/folder/flower.gif', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$_GET、画像のURLを含む変数を使用することを意味すると思いますhttp://example.com/fetch-image.php?url=http://blabla.com/flower.jpg。この例の場合$_GET['url']、次のようにPHPスクリプトを呼び出すだけです$ch = curl_init($_GET['url']);。
                    copy('http://example.com/image.php', 'local/folder/flower.jpg');allow_url_fopen)。
                    $content = file_get_contents('http://example.com/image.php');
file_put_contents('/my/folder/flower.jpg', $content);
ここでは、リモートイメージを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');
VarcのcURLでの回答がうまくいきませんでした。私の特定の問題のために、わずかに改善されました。
例えば、
サーバーにリダイレクトがある場合(facebookのプロフィール画像を保存しようとしている場合など)、次のオプションを設定する必要があります。
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);完全なソリューションは次のようになります。
$ch = curl_init('http://example.com/image.php');
$fp = fopen('/my/folder/flower.gif', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);他のソリューションを機能させることはできませんでしたが、wgetを使用することができました。
$tempDir = '/download/file/here';
$finalDir = '/keep/file/here';
$imageUrl = 'http://www.example.com/image.jpg';
exec("cd $tempDir && wget --quiet $imageUrl");
if (!file_exists("$tempDir/image.jpg")) {
    throw new Exception('Failed while trying to download image');
}
if (rename("$tempDir/image.jpg", "$finalDir/new-image-name.jpg") === false) {
    throw new Exception('Failed while trying to move image file from temp dir to final dir');
}file()PHPマニュアルを参照してください。
$url    = 'http://mixednews.ru/wp-content/uploads/2011/10/0ed9320413f3ba172471860e77b15587.jpg';
$img    = 'miki.png';
$file   = file($url);
$result = file_put_contents($img, $file)サーバーにwkhtmltoimageをインストールしてから、私のパッケージpackagist.org/packages/tohidhabiby/htmltoimageを使用して、ターゲットのURLから画像を生成します。
file_put_contents等