How to calculate distance from lat/long in php?

后端 未结 9 1404
余生分开走
余生分开走 2020-12-09 06:18

What I am trying to do is I have entries in the database which have a lat/long stored with them. I want to calculate the distance between users lat/long and entries lat/long

9条回答
  •  旧时难觅i
    2020-12-09 06:24

    I did this a few weeks ago.

    This link is your best bet:

    http://code.google.com/apis/maps/articles/phpsqlsearch.html

    Even if you don't use their API, their PHP and SQL query helped really well.

提交回复
热议问题