phpdeveloper82 Posted March 11, 2010 Share Posted March 11, 2010 I would like to hear from you about a friend finder method.. Suppose I have the Country, "City" and Zip Code of all persons.. how can I add a functionality to find people who are living around me ? like within 6 kms, 10 kms etc.. Does any website offer this ? Quote Link to comment https://forums.phpfreaks.com/topic/194868-does-any-website-offer-this/ Share on other sites More sharing options...
JonnoTheDev Posted March 11, 2010 Share Posted March 11, 2010 You will need longitude / latitude co-ordinates for each postcode. Then you can use the haversine formula to find things within a given distance of an originating point. Websites like Google Maps use this for instance when you need the distance between point A and point B. Resources http://en.wikipedia.org/wiki/Haversine_formula http://www.pjenkins.co.uk/blog/index.php/2007/04/04/uk_post_code_distance_calculation/ (doesn't matter that it is UK, same formula) Also take a look at: http://www.booking.com/city/gb/london.html You can see the formula in action. The blue module on the left shows places and landmarks that are near the current location (I think it is a 12km radius). Quote Link to comment https://forums.phpfreaks.com/topic/194868-does-any-website-offer-this/#findComment-1024671 Share on other sites More sharing options...
phpdeveloper82 Posted March 11, 2010 Author Share Posted March 11, 2010 Thank you. This will works Quote Link to comment https://forums.phpfreaks.com/topic/194868-does-any-website-offer-this/#findComment-1024672 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.