How can the PHP function mime_content_type be used to determine file types?

The PHP function `mime_content_type` can be used to determine the MIME content type of a file by examining its content. This function can be useful when you need to verify the type of a file uploaded by a user or when you want to process files based on their content type.

// Get the MIME content type of a file
$file_path = 'path/to/file';
$mime_type = mime_content_type($file_path);

// Check the MIME type
if ($mime_type == 'image/jpeg') {
    echo 'This is a JPEG image file.';
} elseif ($mime_type == 'application/pdf') {
    echo 'This is a PDF file.';
} else {
    echo 'Unknown file type.';
}