Get mimetype of an image in php

Posted by pavan - 1 year ago

Get mimetype of an image in php

  $image = getimagesize("imagename.jpg");
   echo $image['mime'];

Results:

 Array
  (
    [0] => 200
    [1] => 125
    [2] => 2
    [3] => width="200" height="125"
    [bits] => 8
    [channels] => 3
    [mime] => image/jpeg
  )