提取显示“数组”的EXIF数据

时间:2013-01-22 12:27:25

标签: php geolocation exif

尝试从照片exif中提取位置数据,但它只显示GPS数据的“数组”。它需要将数据保存到服务器上的日志文件中以进行抓取。难道我做错了什么?照片上肯定有地理位置数据。

<?php
    $image = "narnia.jpg";
    $exif = exif_read_data($image, 0, true);
    foreach ($exif as $key => $section) {
    foreach ($section as $name => $val) {
    echo "$key.$name: $val<pre>\n</pre>";
    }
    }
?>

GPS.GPSLatitudeRef: N
GPS.GPSLatitude: Array
GPS.GPSLongitudeRef: W
GPS.GPSLongitude: Array
GPS.GPSTimeStamp: Array

1 个答案:

答案 0 :(得分:2)

是的,因为它是一个数组。

print_r($val);

http://codepad.viper-7.com/PPJtsB