PHP MySql and geolocation
问题 I am writing a site that basically looks for places within a 25 mile radius of a lat and long using php and mysql. I am wondering how something like this would work? I would pass a lat and long to the scrip and have it pull out only locations that are within 25 miles of the lat and long from my Database of locations. What is the best way to do this? EDIT: I found this code for calculating the distance between 2 points. function distance($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 -