I write this simple code to save an image:
// $randomimage contains a random image url.
$content = file_get_contents($randomimage);
file_put_contents('images/'.$randomimage, $content);
I need a way to NOT rewrite an image with the same name. So, if an image with a certain name already exist in my /images/ folder, then do NOTHING. It's simple but I don't know how to do that.