Is there a built-in function in php or something similar, in order to know the MIME file - to display the format. For example:

image/gif -> gif image/jpeg - jpg 

etc.

PS You can of course use regular expressions, but can it still be somehow different?

  • See Fileinfo or GD functionality for images. - UserName

1 answer 1

All expectations about the easy decision, broken on the harsh reality:
What extension to choose, for example, for application/octet-stream ?

Unless to collect an array of mime -> ext .