1. Go to this page and download the library: Download netliva/helpers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
//...
$ip_geo_helper = new Netliva\Helper\IpGeo();
echo $ip_geo_helper->getIp();
// output: "123.123.123.123" (ip of your)
echo $ip_geo_helper->getInfo("city");
// output: "Izmir" (city of your location)
//...
//...
$ip_geo_helper = new Netliva\Helper\IpGeo();
$ip_geo_helper->setIp("172.217.168.238");
echo $ip_geo_helper->getInfo("country");
// output: "United States" (country of google ip location)
//...