How could I get the file type category only?
For example:
$fileType = $_FILES['userfile']['type'];
echo $fileType;
In this code, it displays image/jpeg
. Now what I want to get is only the image
without the jpeg.
Same also with all of this:
Displays image only if the file type is:
and displays text only if file type is:
and so on, with the other file type..
Any help is highly appreciated. Thanks
Ugly, and may not work on all file types:
$type = explode('/', $filetype)[0];