PHP code example of pouduo / iplocation

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

    

pouduo / iplocation example snippets


    use PouDuo\IpLocation\IpLocation;


   public function getArea(Request $request)
    {
        $IpLocation = new IpLocation();
        $area = $IpLocation->getlocation($request -> ip());
        return $area;
    }