title: EXIF (or other meta-data) data that Windows displays but PHP does not
body: <p>I am working to pull some information from JPEGs supplied to my client by a photographer.</p>
  
  <p>When examined under Windows all of the images contain data in a field called Tags:</p>
  
  <p><img src="https://i.stack.imgur.com/Mk4bs.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Q4tqy.jpg" alt="enter image description here"></p>
  
  <p>To do some testing first I made the following script and am iterating over entries in the binary file headers using the code below.</p>
  
  <p>Sometimes I get values for ImageDescription.  Often text in Copyright and Author but the Tags content never ever shows up here and it is the capture of that content the client most wants to automate.</p>
  
  <p>Can anyone advise me as to how I can access the Tags field content?</p>
  
  <p>Uploaded copy of file is <a href="http://nolaflash.com/stackoverflow/ANI_69.jpg" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>UPDATE</strong> - changed IDF0 to ANY_TAG and added 3rd arg <strong>true</strong> to exif_read_data() per Tiger-222's response.  Also added print_r output at end of post</p>
  
  <p><strong>UPDATE 2</strong> Added requested error_display() and ini_set() calls and also tried exif_read_data() 2nd arg of 0 in place of 'ANY_TAG' per <a href="https://php.net/manual/en/function.exif-read-data.php" rel="nofollow noreferrer">https://php.net/manual/en/function.exif-read-data.php</a></p>
  
  <pre><code>&lt;?php
      ini_set('display_errors', 1);
      ini_set('exif.encode_unicode', 'UTF-8');  // To see WINXP values
      error_reporting(-1);        
      $n = (intval($_GET['n'])) ? $_GET['n'] : 99;
      echo "ANI_$n.jpg:&lt;br /&gt;\n";
      $exif = exif_read_data("ANI_$n.jpg", 'ANY_TAG', true);
      echo $exif===false ? "No header data found.&lt;br /&gt;\n" : "Image contains the following headers:&lt;br&gt;&lt;br /&gt;\n";
  
      if ($exif) {
          foreach ($exif as $key =&gt; $section) {
              if (is_array($section)) {
                  foreach ($section as $name =&gt; $val) {
                      echo "$key.$name: $val&lt;br /&gt;\n";
                  }
              } else {
                  echo "$key: $section&lt;br&gt;\n";
              }
          }
      }
  ?&gt;
  </code></pre>
  
  <p>The following is the content dumped by the script for the whooping crane image:</p>
  
  <pre><code>ANI_69.jpg:
  Image contains the following headers:
  
  FileName: ANI_69.jpg
  FileDateTime: 1428255617
  FileSize: 2448245
  FileType: 2
  MimeType: image/jpeg
  SectionsFound: ANY_TAG, IFD0, THUMBNAIL, EXIF
  COMPUTED.html: width="1798" height="2697"
  COMPUTED.Height: 2697
  COMPUTED.Width: 1798
  COMPUTED.IsColor: 1
  COMPUTED.ByteOrderMotorola: 0
  COMPUTED.Copyright: Photographer name here
  COMPUTED.Thumbnail.FileType: 2
  COMPUTED.Thumbnail.MimeType: image/jpeg
  ImageWidth: 1798
  ImageLength: 2697
  BitsPerSample.0: 8
  BitsPerSample.1: 8
  BitsPerSample.2: 8
  PhotometricInterpretation: 2
  Orientation: 1
  SamplesPerPixel: 3
  XResolution: 1000000/10000
  YResolution: 1000000/10000
  ResolutionUnit: 2
  Software: Adobe Photoshop CS6 (Macintosh)
  DateTime: 2014:12:28 19:17:36
  Artist: Photographer name here
  Copyright: Photographer name here
  Exif_IFD_Pointer: 316
  THUMBNAIL.Compression: 6
  THUMBNAIL.XResolution: 72/1
  THUMBNAIL.YResolution: 72/1
  THUMBNAIL.ResolutionUnit: 2
  THUMBNAIL.JPEGInterchangeFormat: 554
  THUMBNAIL.JPEGInterchangeFormatLength: 3211
  ExifVersion: 0230
  DateTimeOriginal: 2014:11:03 11:14:27
  DateTimeDigitized: 2014:11:03 11:14:27
  SubSecTimeOriginal: 76
  SubSecTimeDigitized: 76
  ColorSpace: 65535
  ExifImageWidth: 1798
  ExifImageLength: 2697
  </code></pre>
  
  <p>Here's a dump of $exif from <code>$exif = exif_read_data("ANI_$n.jpg", 'ANY_TAG', true);</code></p>
  
  <pre><code>Array
  (
      [FILE] =&gt; Array
          (
              [FileName] =&gt; ANI_69.jpg
              [FileDateTime] =&gt; 1428255617
              [FileSize] =&gt; 2448245
              [FileType] =&gt; 2
              [MimeType] =&gt; image/jpeg
              [SectionsFound] =&gt; ANY_TAG, IFD0, THUMBNAIL, EXIF
          )
  
      [COMPUTED] =&gt; Array
          (
              [html] =&gt; width="1798" height="2697"
              [Height] =&gt; 2697
              [Width] =&gt; 1798
              [IsColor] =&gt; 1
              [ByteOrderMotorola] =&gt; 0
              [Copyright] =&gt; Digital Roux Photography LLC
              [Thumbnail.FileType] =&gt; 2
              [Thumbnail.MimeType] =&gt; image/jpeg
          )
  
      [IFD0] =&gt; Array
          (
              [ImageWidth] =&gt; 1798
              [ImageLength] =&gt; 2697
              [BitsPerSample] =&gt; Array
                  (
                      [0] =&gt; 8
                      [1] =&gt; 8
                      [2] =&gt; 8
                  )
  
              [PhotometricInterpretation] =&gt; 2
              [Orientation] =&gt; 1
              [SamplesPerPixel] =&gt; 3
              [XResolution] =&gt; 1000000/10000
              [YResolution] =&gt; 1000000/10000
              [ResolutionUnit] =&gt; 2
              [Software] =&gt; Adobe Photoshop CS6 (Macintosh)
              [DateTime] =&gt; 2014:12:28 19:17:36
              [Artist] =&gt; Digital Roux Photography LLC
              [Copyright] =&gt; Digital Roux Photography LLC
              [Exif_IFD_Pointer] =&gt; 316
          )
  
      [THUMBNAIL] =&gt; Array
          (
              [Compression] =&gt; 6
              [XResolution] =&gt; 72/1
              [YResolution] =&gt; 72/1
              [ResolutionUnit] =&gt; 2
              [JPEGInterchangeFormat] =&gt; 554
              [JPEGInterchangeFormatLength] =&gt; 3211
          )
  
      [EXIF] =&gt; Array
          (
              [ExifVersion] =&gt; 0230
              [DateTimeOriginal] =&gt; 2014:11:03 11:14:27
              [DateTimeDigitized] =&gt; 2014:11:03 11:14:27
              [SubSecTimeOriginal] =&gt; 76
              [SubSecTimeDigitized] =&gt; 76
              [ColorSpace] =&gt; 65535
              [ExifImageWidth] =&gt; 1798
              [ExifImageLength] =&gt; 2697
          )
  
  )
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/oToIp.jpg" alt="enter image description here"></p>