How can one determine the MIME type of a file in PHP 5.5?
To determine the MIME type of a file in PHP 5.5, you can use the `finfo_open` and `finfo_file` functions. `finfo_open` creates a new fileinfo resource and `finfo_file` returns the MIME type of the file. This allows you to accurately determine the MIME type of a file in PHP.
// Create a new fileinfo resource
$finfo = finfo_open(FILEINFO_MIME_TYPE);
// Get the MIME type of a file
$mime_type = finfo_file($finfo, 'path/to/your/file.jpg');
// Close the fileinfo resource
finfo_close($finfo);
// Output the MIME type
echo $mime_type;