С помощью пакета:
use ItForFree\rusphp\File\MIME; $mimeTypes = MIME::getAllbyExtentions(['png', 'jpg']);