How to calculate distance between two location by PHP Code

Visit Publisher Site
Get How to calculate distance between two location by PHP Code Hosting

Sponsored by TMDHosting

If you would like to calculate air distance between two location without any API or mysql query. You can use below code to get distance between two location. $distance_one_latitude = 30.364267; $distance_two_latitude = 30.324860; $distance_one_longitude = 78.087412; $distance_two_longitude = 78.052046; $theta = $distance_one_longitude - $distance_two_longitude; $dist = sin(deg2rad($distance_one_latitude)) * sin(deg2rad($distance_two_latitude)) + cos(deg2rad($distance_one_latitude)) * cos(deg2rad($distance_two_latitude)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $distance = $dist * 60 * 1.1515; echo $distance = round($distance, 2);

Visit publisher site: How to calculate distance between two location by PHP Code

Listing Details

Filed in:
Scripts / PHP / Scripts & Programs / Website Builders
Submitted on:
 
Last Updated:
Jun 24, 2015 
Publisher:
Other listings by this publisher

License & Pricing Information

LICENSE #1
License Type:
Freeware
Price:
$0.00 USD
Additional Info:

Featured Marketplace Listings

User Reviews 

Be the first to review this listing!
Average Member Rating: 2.20/5