An API in PHP to get the location and some other details related to the location.
First of all download the file LocationDetails.php and place it in your project folder. Now add the file LocationDetails.php to your project file by requiring it.
require "LocationDetails.php";
Simply create an object for the class LocationDetails.
$ob = new LocationDetails();
Call the getLocationDetails() and it will return a json arry with details on current location.
$ob->getLocationDetails();
You could modify the code and also pass the ip address as argument to the function.
You could also get user IP by calling getUserIP().
$ob->getUserIP();
Feel free to report any issues related to this.
- Vishnu Sivadas - Developer - Website
Check out my other works @VishnuSivadasVS