Php 提取EXIF数据显示';数组';

Php 提取EXIF数据显示';数组';,php,geolocation,exif,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

试图从照片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

GPS.GPSLatitudeRef:N
GPS.GPSLatitude:阵列
GPS.gpsLogitudeRef:W
GPS.gpsLangUde:阵列
GPS.GPSTimeStamp:阵列

是的,因为它是一个数组


谢谢,我在代码下添加了这一点,它成功了。我已经尝试过调整它,只打印GPS阵列,因为这就是我所需要的<代码>$image=“narnia.jpg”$exif=exif\u读取数据($image,0,true)$lon=getGps($exif['GPSLongitude]”,$exif['GPSLongitudeRef'])$lat=getGps($exif[“GPSLatitude”],$exif['GPSLatitudeRef']);var_dump($lat,lon)但这不起作用。我也尝试过打印($lat,lon)而不是
var\u dump
print_r($val);