1. Go to this page and download the library: Download dimchtz/clientip 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/ */
dimchtz / clientip example snippets
$client = new DimChtz\ClientIP\ClientIP();
$client = new DimChtz\ClientIP\ClientIP(array(
'http://v4.ident.me/',
'http://checkip.amazonaws.com/',
'http://ipecho.net/plain',
));
$client = new DimChtz\ClientIP\ClientIP();
echo 'Visitor\'s IP: ' . $client->get_ip(false);
$client = new DimChtz\ClientIP\ClientIP();
echo 'Visitor\'s IP: ' . $client->get_ip();