<?php
$imgSrc = "image.jpg";
if (exif_imagetype($imgSrc) == IMAGETYPE_GIF) {
$filetype = 'The picture is GIF';
}
if (exif_imagetype($imgSrc) == IMAGETYPE_JPEG) {
$filetype = 'The picture is JPEG';
}
if (exif_imagetype($imgSrc) == IMAGETYPE_PNG) {
$filetype = 'The picture is PNG';
}
echo $filetype;
Fatal error: Uncaught Error: Call to undefined function exif_imagetype() in /in/a6CQj:5
Stack trace:
#0 {main}
thrown in /in/a6CQj on line 5
Process exited with code 255.
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 5
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 8
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 11
Notice: Undefined variable: filetype in /in/a6CQj on line 14
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 5
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 8
Warning: exif_imagetype(image.jpg): failed to open stream: No such file or directory in /in/a6CQj on line 11
Notice: Undefined variable: filetype in /in/a6CQj on line 14
Output for 4.3.0 - 4.3.1
Warning: exif_imagetype(image.jpg) [http://www.php.net/function.exif-imagetype]: failed to create stream: No such file or directory in /in/a6CQj on line 5
Warning: exif_imagetype(image.jpg) [http://www.php.net/function.exif-imagetype]: failed to create stream: No such file or directory in /in/a6CQj on line 8
Warning: exif_imagetype(image.jpg) [http://www.php.net/function.exif-imagetype]: failed to create stream: No such file or directory in /in/a6CQj on line 11
Notice: Undefined variable: filetype in /in/a6CQj on line 14