How to get file type in php?
I had tried following codes
$attachment_path = "/views/default/helpcentre/check_attachment/wildryan.jpg";
$file_type = filetype($attachment_path);
$mime_type = mime_content_type($attachment_path);
echo "Type of the file: ".$file_type;
echo "Mime Type of the file: ".$mime_type;
File type is not returned. if there is any error in my codes. please intimate me how to get file type.
Alternative: Will return
image/jpeg