I got the filename and path (gallery/thumbnail) where thumbnail can be png,jpg or mp4. it will always have the name "thumbnail" and i will always know the path.
How to find out what format the file is with php?
Edit.
I do not have the full file name (gallery/thumbnail.png) I only go the path without the extension (gallery/thumbnail.)
$fileName = "gallery/thumbnail.png' //file could be this
$fileName = "gallery/thumbnail.jpg"; //or this
$fileName = "gallery/thumbnail."; //but i only know this