PHP code example of cravler / maxmind-geoip-bundle
1. Go to this page and download the library: Download cravler/maxmind-geoip-bundle 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/ */
cravler / maxmind-geoip-bundle example snippets
php
// config/bundles.php
return [
// ...
Cravler\MaxMindGeoIpBundle\CravlerMaxMindGeoIpBundle::class => ['all' => true],
];
bash
php bin/console cravler:maxmind:geoip-update
php
$geoIpService = $container->get('cravler_max_mind_geo_ip.service.geo_ip_service');
$client = $geoIpService->getClient();
$record = $client->city('128.101.101.101');