Exif data, is meta-data stored within digital photos which can provide very useful information such as the model of camera used to take it, right down to the exact settings used. PHP provides some inbuilt functionality to grab this data out of any image file which has it.
Here is a quick example of how you might do it. There are hundreds of pieces of data you can select, but these are probably some of the more commonly sought after.
<?
// read data
$exif = exif_read_data('IMG_1242.jpg', 'IFD0');
// fields to grab
$fields = array(
'DateTime', 'Make', 'Model',
'ShutterSpeedValue', 'ApertureValue',
'ExifImageWidth', 'ExifImageLength'
);
// if no image data returned
if($exif === false)
echo('No Exif Data Found.');
else
{
foreach($fields as $field)
echo('<b>'. $field .':</b> '. $exif[$field] .'<br />');
}
?>




