Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do imagejpeg(), imagepng() and imagegif() replace existent files?

The title explains it quite well, do imagejpeg(), imagepng() and imagegif() replace an existent file if I use the 2nd parameter of these functions?

The second parameter is the location where you want to store the created image, but what if there is already a file with the name I chose? How do these functions handle those situations?

Thanks.

like image 737
aborted Avatar asked Dec 26 '12 21:12

aborted


2 Answers

Yes, they will overwrite an existing file at the specified path, if it already exists.

like image 115
Amber Avatar answered Sep 20 '22 03:09

Amber


Yes, I test it by myself, it will replace the existent file if you use the 2nd parameter of these functions !

like image 43
Chen Yunhui Avatar answered Sep 22 '22 03:09

Chen Yunhui