So this is a snip of my current PHP script:
// Check if the form was submitted
if($_SERVER["REQUEST_METHOD"] == "POST"){
// Check if file was uploaded without errors
if(isset($_FILES["photo"]) && $_FILES["photo"]["error"] == 0){
//$allowed = array("PNG" => "image/png");
$allowed = array("jpg" => "image/jpg", "jpeg" => "image/jpeg", "gif" => "image/gif", "png" => "image/png");
$filename = $_FILES["photo"]["name"];
$filetype = $_FILES["photo"]["type"];
$filesize = $_FILES["photo"]["size"];
// Verify file extension
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if(!array_key_exists($ext, $allowed)) die("Error: Choose between .jpg, .jpeg, .gif, .png. Your format is: $ext");
So currently these extensions are allowed: .jpg, .jpeg, .gif, .png. When someone add image with extension image.jpg it works fine, but when trying to save `image.JPG, it doesn't work. How can I fix this?