-1

Okay - I was able to the pass a string assigned to the variable $myfile into the function. If it could be better, please provide feedback- learning PHP.

<?php
$myfile = $row_rs_recordview['headstone'];
echo "$myfile"; // verify the file name
function readGPSinfoEXIF($myfile)
{    
 global $myfile;
 $exif= exif_read_data("headstone/".$myfile, 0, true); //
 if(!$exif || $exif['GPS']['GPSLatitude'] == '') //Determines if the
                          //geolocation data exists in the EXIF data
 {
      return false; //no GPS Data found
      echo "No GPS DATA in EXIF METADATA";
 }
?>

Insights appreciated!

Thanks

xyz
  • 1
  • 2

1 Answers1

1

you can't access the global variables inside function directly.

//add global before variable declaration like this
function fun(){  
   global $row_rsUpdate['headstone'];
}
Aqib
  • 304
  • 3
  • 5