Reputation: 7944
$finfo = new Finfo();
echo $finfo->file('image.jpg' );
As this stands, it outputs "JPEG image data, JFIF standard 1.01"
How can I modify this behaviour to output "image/jpeg"?
I would have liked to use the 'file' command but I'm not permitted to run system commands.
Upvotes: 0
Views: 77
Reputation: 57316
You have to specify what info you need - FILEINFO_MIME_TYPE
in your case:
$finfo = new Finfo(FILEINFO_MIME_TYPE);
echo $finfo->file('image.jpg');
Outputs:
image/jpeg
Upvotes: 2