PHP code example of 1tomany / exif-tools
1. Go to this page and download the library: Download 1tomany/exif-tools library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
1tomany / exif-tools example snippets
use OneToMany\Reader\ExifTagReader;
// $exifTags is an ExifMap object
$exifTags = new ExifTagReader()->read('/path/to/photo.jpeg');
var_dump($exifTags->has('FileName')); // bool(true)
var_dump($exifTags->get('FileName')->value()); // string(10) "photo.jpeg"
// Iterate over the tags
foreach ($exifTags as $tag => $value) {
printf("%s: %s\n", $tag, $value);
}