Tag Archives | image type

Check image type in PHP

Quick PHP tip: If you’re looking to determine the type of uploaded image you can use the following code: $type = exif_imagetype($_FILES[‘uploaded_image’][‘tmp_name’]); if ($type == 1 || $type == 2 || $type == 3) { //image type is jpg, gif or png } The code above shows a snippet to check if the uploaded image […]

Continue Reading 0