I want to update my image but I want if I am not updating any image then the previous image should not be removed But right now if I am not passing "image" parameter then I am getting the following error "Message: Undefined index: image", I just want that if I do not pass "image" parameter then the error should not display, How can I resolve this error? Here is my code
if (!file_exists($_FILES['image']['tmp_name']) || !is_uploaded_file($_FILES['image']['tmp_name'])) {
} else {
$filename = time() . uniqid(rand()) . $_FILES['image']['name'];
move_uploaded_file($_FILES["image"]["tmp_name"], "vendorProfile/" . $filename);
$saveArr['image'] = $filename;
}