I am try to writing PHP code that generate unique file name.
First of all it will check if first given name file 'Vector background' exits or not in folder .If yes it will add 1 in last so file name will be 'Vector background 1' so it will check again if yes than ad one i last so new name will be 'Vector background 11' it will do while it will get unique name.
i try my self
$folder='C:\Users\Desktop\file exits\\';
$name='log';
$result=file_exists($folder.$name);
if ($result == "1") { //// file exits so work start
///// generate name file that not exists in folder
$name=$name.' 1';
$result=file_exists($folder.$name);
if ($result == "1") {
$name=$name.' 1';
$result=file_exists($folder.$name);
}
}
well that is my progress it is not smart code