Get latitude and longitude from an address with PHP and Google Maps API

Must Read : Get latitude and longitude from an address with PHP and Google Maps API

The given PHP example convert an address to geocode Latitude/Longitude positioning with Google Maps.
It took me a little while to get this to work. For some reason the various cURL and file_get_contents methods I saw online to get longitude and latitude values didn’t work for me and I needed to add ‘true’ to the ‘file_get_contents’ command for json_decode to work correctly. Hopefully this will help someone else out

(Visited 138 times, 1 visits today)

Leave a Comment.