Fetch Location via Google Map in PHP

I want to make link where when any only click on that then he will redirect to google map and there zoom with href linked text.

example : <a href="www.google.com/map/wasington DC">Click Here</a> => click ==> Open Map ==> locate

How I do that in PHP ?

I don’t really understand the question. Where does the link come from - do you have a database of place names?

1 Like

I think you may be asking how to have a link that you click on that takes you to Google Maps, to a predefined location such as your location so they can then zoom - then why use PHP ? Why not just copy and paste the link like this -
Statue of Liberty

1 Like

Exactly I am asking that but I don’t have longitude and latitude number I simply want to fetch data via address. How I do that ?

The only way I know is to locate first on Google maps and then copy and paste the url
You can search google maps by address or post code

Your explanation is not that detailed. But assuming you in fact want to display a location on Google Maps based on user input. For example they enter an address click ‘Locate’ button and the map is displayed. Then that is beyond my skill set but you could check out Geocoding which is the process of converting an address int latitude and longitude - which you could feed into a Google Maps url -I don’t know much more about this but you could check out -
Geocoding
But you will have to get familiar with the API

You can add a search query to the URL.

https://www.google.com/maps/?q=statue+of+liberty

Note spaces replaced with +

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.