Getting an Image's MIME Type
<?php $info = getimagesize("button.png"); print image_type_to_mime_type($info[2]); ?>