Get an Image's MIME Type in PHP

Description

The following code shows how to get an Image's MIME Type.

Example


//from w  w w  .ja  v a 2s. co  m
<?php
    $info = getimagesize("test.png");
    print image_type_to_mime_type($info[2]);
?>

The code above generates the following result.

Get an Image




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text