|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2020-03-05 (2 months ago) ||Not enough user ratings||Total: 122 This week: 1||All time: 9,119 This week: 318|
This class can calculate the distance between two world locations.
It can take the latitude and longitude coordinates of two locations in the worlds and calculates the distance between them.
The calculated distance can be returned as a string with the distance and optionally the distance unit in miles, kilometers, yards, meters and feets.
Calculate the distance between two points in Miles, Kilometers, Yards, Meters and Feets
//includee the class
$dc = new DistanceCalculator();
//latitude and logtitude of point 1
$dc->lat1 = 33.6437323;
$dc->long1 = 72.9585014;
//latitude and logtitude of point 2
$dc->lat2 = 33.6655587;
$dc->long2 = 73.0022321;
//define the unit of distance you want to get get data, default is 'miles'
$dc->type = 'km';
//choose if you want to display the selected unit type with the distance value, default is 'true'
$dc->show_type = false;
//calculate and get the distance
$distance = $dc->getDistance();
//show the calculated distance
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.