PHP code example of byrnes2014 / geoip

1. Go to this page and download the library: Download byrnes2014/geoip 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/ */

    

byrnes2014 / geoip example snippets


use Byrnes2014\GeoIP\GeoIP;

$key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';

$geoip = new GeoIP($key);

$response = $geoip->getAddress('101.80.72.241');

$response = $geoip->getAddress('101.80.72.241', 'xml');

	.
	.
	.
	 'weather' => [
		'key' => env('GEOIP_API_KEY'),
    ],

	.
	.
	.
	public function edit(GeoIP $geoip) 
	{
		$response = $geoip->getAddress('101.80.72.241');
	}
	.
	.
	.

	.
	.
	.
	public function edit() 
	{
		$response = app('geoip')->getAddress('101.80.72.241');
	}
	.
	.
	.