What I’m looking for is something which will take any file extension given to it and return a description of that extension.
For example :
$extension = 'PNG';
$description = ext_description($extension);
echo $description // Outputs 'Portable Network Graphic'
OR
$extension = 'DOC';
$description = ext_description($extension);
echo $description // Outputs 'Microsoft Office Word Document'
I’ve searched google and nothing came up. It would be a huge time saver if anyone knew if such a script existed.
Thanks in advance.
Yes there is, one is the getID3 Library and there is the PHP build in fileinfo library.
As the description for everybody is something else, you can create a simple look-up function that works on array data. You only need to add your file-types into the array and you’re done: