Skip to content

Instantly share code, notes, and snippets.

@growdev
Created July 12, 2016 16:28
Show Gist options
  • Save growdev/a056ec99f62a2d9cc076763f0c0eaad6 to your computer and use it in GitHub Desktop.
Save growdev/a056ec99f62a2d9cc076763f0c0eaad6 to your computer and use it in GitHub Desktop.
EXIF Data
<?php
echo "START\n";
$file_name ='IMG_2869.JPG';
$exif = exif_read_data( $file_name, 'IDF0' );
echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
$exif = exif_read_data( $file_name, 0, true );
echo "$file_name:\n";
//print_r( $exif );
echo "TITLE: " . $exif['FILE']['FileName'] . "\n";
echo "DATE : " . $exif['EXIF']['DateTimeOriginal'] . "\n";
echo "END\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment