danielsonsilva / findme
Package to help you find anything in this world and other methods relating to GPS
v1.0.0
2020-06-04 19:50 UTC
Requires
- mjaschen/phpgeo: ^3.0
Requires (Dev)
- phpunit/phpunit: ^9.1
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-05 08:12:06 UTC
README
Package to help find you in this world and several others auxiliar methods relating to GPS
This library uses the service from https://ipstack.com/
How To Use
// create your object using your API Key from IpStack
$findMeObject = new FindMe('DUuhew712hnhNNASbdnw90');
// Get the IP string from your cliente and set the information
$findMeObject->setInformationFromIp($ip);
// Now that you have your object loaded, you can use methods like
echo $findMeObject->getCountryName();
// Or you can define new latitudes and longitudes
$destinyLatitude = -15.90377472;
$destinyLongitude = 9.673627181;
// And get the distance though three different ways
echo $findMeObject->getDistanceTo($destinyLatitude, $destinyLongitude); //in kilometers
echo $findMeObject->getDistanceToVicenty($destinyLatitude, $destinyLongitude); //in meters
echo $findMeObject->getDistanceToHaversine($destinyLatitude, $destinyLongitude); //in meters