Output: MIME type of image.png is image/png Example 2: Getting MIME type of a PDF filephp $file = "document.pdf"; $mime_type = mime_content_type($file); echo "MIME type of $file is $mime_type"; ``` Output: MIME type of document.pdf is application/pdf The package library for this function is "Fileinfo" extension in PHP. It is included in most PHP installations and can be easily installed if not present.