What are some common issues with file uploads in PHP, specifically when handling different file formats like GIF and JPEG?

One common issue when handling different file formats like GIF and JPEG in PHP file uploads is ensuring that the uploaded file is of the correct format. To solve this, you can use the `getimagesize()` function to check the MIME type of the uploaded file.

// Check if the uploaded file is a valid image
$uploadedFile = $_FILES['file']['tmp_name'];
$imageInfo = getimagesize($uploadedFile);

if ($imageInfo === false) {
    die("Invalid image file");
}

// Continue processing the uploaded file