Background

Back in the good old days, I often test PHP applications by accessing it directly from the web browser and input the data in the forms. Today, with the explosion of awesome PHP libraries we can now generate most kinds of data by using code alone. The data can then be directly inserted into the database. This reduces the need to input data directly into the app. In Laravel application, there’s an awesome package for this called Faker - a PHP library that generates fake data for you. Faker is not exactly Laravel package, but perfectly works with this framework as well. Check their github page: https://github.com/fzaninotto/Faker

Problem

I have a client which sell foods and offer free delivery for small covered area. To check whether a coordinate is still covered by its service, I need to calculate the distance. There are many PHP functions shown up when we searched "calculate distance between two coordinates php", but I need the result to closely match with Google because I display the covered area in Google map.