PHP built-in function gets the picture type-exif_imagetype

Source: Internet
Author: User

Get the picture type in PHP can use Exif_imagetype in PHP built-in functions

Pre-defined constants
The following constants are defined and represent the possible return values of Exif_imagetype ():

Image type constant Value constant
1 imagetype_gif
2 Imagetype_jpeg
3 Imagetype_png
4 imagetype_swf
5 IMAGETYPE_PSD
6 imagetype_bmp
7 Imagetype_tiff_ii (Intel byte order)
8 imagetype_tiff_mm (Motorola byte order)
9 IMAGETYPE_JPC
Ten IMAGETYPE_JP2
Imagetype_jpx
Imagetype_jb2
Imagetype_swc
Imagetype_iff
Imagetype_wbmp
Imagetype_xbm

#1 exif_imagetype () Example

<?php

if (exif_imagetype("image.gif") != IMAGETYPE_GIF) {
    echo "The picture is not a gif";
}

?>

PHP built-in function gets the picture type-exif_imagetype

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.