I created a variable named $extension, but I keep getting the following error when I try to utilize it in my code: $extension is not defined; there is an error 500.
This is the code:
This is the code:
PHP:
$extension = strtolower(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION));
$errors['image_file'] .= in_array($extension, $file_extensions) ? '' : 'Wrong file extention ';