3v4l.org

run code in 300+ PHP versions simultaneously
<? ini_set('display_errors', 'On'); error_reporting(E_ALL); // determine image format print "1\n"; if (exif_imagetype('http://23mox.com/php/GoogleMapAPI/IMG_0266_mod.JPEG') == IMAGETYPE_JPEG) { print "Hey, this is a JPEG image"; } print "2"; // extra thumbnail from EXIF data, this sometimes help and you // do not need to generate your own thumbnails, most digital // cameras provide a thumbnail $thumb_image = exif_thumbnail($original_file, $width, $height, $type); print "Height: $height \nWidth: $width \nType: $type"; // save thumbnail to a file file_put_contents($path_to_thumb_image,$thumb_image); // read all available tags into an associative array $exif_data = exif_read_data($original_file, 'ANY_TAG'); foreach ($exif_data as $key => $section_data) { foreach ($section_data as $name => $val) { print "$key.$name : $val \n"; } } ?>
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
<? ini_set('display_errors', 'On'); error_reporting(E_ALL); // determine image format print "1\n"; if (exif_imagetype('http://23mox.com/php/GoogleMapAPI/IMG_0266_mod.JPEG') == IMAGETYPE_JPEG) { print "Hey, this is a JPEG image"; } print "2"; // extra thumbnail from EXIF data, this sometimes help and you // do not need to generate your own thumbnails, most digital // cameras provide a thumbnail $thumb_image = exif_thumbnail($original_file, $width, $height, $type); print "Height: $height \nWidth: $width \nType: $type"; // save thumbnail to a file file_put_contents($path_to_thumb_image,$thumb_image); // read all available tags into an associative array $exif_data = exif_read_data($original_file, 'ANY_TAG'); foreach ($exif_data as $key => $section_data) { foreach ($section_data as $name => $val) { print "$key.$name : $val \n"; } } ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6, 7.3.32 - 7.3.33, 7.4.33, 8.0.13
1 Fatal error: Uncaught Error: Call to undefined function exif_imagetype() in /in/k2jni:8 Stack trace: #0 {main} thrown in /in/k2jni on line 8
Process exited with code 255.
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
1 Fatal error: Call to undefined function exif_imagetype() in /in/k2jni on line 8
Process exited with code 255.

preferences:
127.22 ms | 409 KiB | 5 Q