I’m using fileinfo to get MIME-Types and description.
At the moment I create two finfo Objects, like this:
$x = new finfo(FILEINFO_NONE, ....);
print $x->file($filename);
print '\n';
$x = new finfo(FILEINFO_MIME, ....);
print $x->file($filename);
This results in something like this:
application/pdf; charset=binary
PDF document, version 1.2
It works fine for me, but is there a way to get description and mime info in one call?
Uh, is really simple, i don’t know how i could not have seen this earlier:
For the method “file”, there is a second optional argument, like this: