PHP code example of saeedvaziry / ip2location
1. Go to this page and download the library: Download saeedvaziry/ip2location 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/ */
saeedvaziry / ip2location example snippets
// returns an array
\SaeedVaziry\IP2Location\Facades\IP2Location::info($ipAddress);
// returns the country full name
\SaeedVaziry\IP2Location\Facades\IP2Location::countryName($ipAddress);
// returns the country 2 character ISO code
\SaeedVaziry\IP2Location\Facades\IP2Location::countryCode($ipAddress);
// returns an array
ip2location_info($ipAddress);
// returns the country full name
ip2location_country_name($ipAddress);
// returns the country 2 character ISO code
ip2location_country_code($ipAddress);
shell
php artisan ip2location:update