DEV Community

кαтнєєѕкυмαɾ
кαтнєєѕкυмαɾ

Posted on

How to get Geo location in PHP

I was created a composer package for get GEO Location from the users. This package help to find location info and service provider information.

https://packagist.org/packages/katheesh/visitorinfo

💥 Installation

# install it via composer
composer require katheesh/visitorinfo
Enter fullscreen mode Exit fullscreen mode

💥 To use in your program

require_once __DIR__ . '/vendor/autoload.php';

use VisitorInfo\GetInfo;

$info = new GetInfo;


    // get IP and geographical information about your client
echo $info->getGeoInfo();

    // get service provider information about your client
echo $info->getProviderInfo();

     // get hosting provider information about your client
echo $info->getHostingInfo();

Enter fullscreen mode Exit fullscreen mode

Thank you for your time

😍 Have a good day.

Top comments (0)