画像を保存するために、次の簡単なコードを書きます。
// $randomimage contains a random image url.
$content = file_get_contents($randomimage);
file_put_contents('images/'.$randomimage, $content);
同じ名前の画像を書き換えない方法が必要です。したがって、特定の名前の画像が /images/ フォルダーに既に存在する場合は、何もしないでください。それは簡単ですが、私はそれを行う方法がわかりません。