0

I'm trying to get the comment information from a JPG. My example below returns ?

Because it's grabbing the wrong comment.

[WINXP] => Array ( [Comments] => ????????????????????????????????? )

  While I need it to grab specifically,

 [IFD0] => Array ( [Exif_IFD_Pointer] => 2110 [Comments]

   

Code:

<?php
$exif_data = exif_read_data('28058990_1835355009821464_5937004451156759325_n.jpg', 0, true);
echo $exif_data===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";

echo $exif_data['Comments'];

print_r($exif_data);
?>
L Y E S - C H I O U K H
  • 4,765
  • 8
  • 40
  • 57
JZersche
  • 11
  • 3

1 Answers1

0

I ended up doing it this way..

<?php
$exif_data=exif_read_data('28058990_1835355009821464_5937004451156759325_n.jpg', 0, true);
$values=array();

foreach($exif_data as $exif => $key) 
  {
    foreach($key as $value) 
      {
       $items[] = $value;
      }
  }

echo '<img src='.$items[0].' width="256px"><br />'.$items[12];
?>
JZersche
  • 11
  • 3