belal/ip-info

Simple php package to get country from IP address

Installs: 2 267

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/belal/ip-info

v1.0.0 2022-08-23 13:05 UTC

This package is auto-updated.

Last update: 2025-12-25 01:59:20 UTC


README

usage

  • Require the package using composer
composer require belal/ip-info
  • To use it simply call the 'getInfo' method after intanshate an instance of the IpDataProvider class
$IpData = new IpDataProvider();

$result = $IpData->getInfo("Any Ip Address")
  • The getInfo method returns a IpData opject witch can be used like:
$result->getIpInRequset()

$result->getPassedIp()

$result->getCountry()

$result->getCity()

$result->getCountryCode()

$result->getContinent()

$result->getTimeZone()
  • the getIpInRequset is the ip the request made with

  • the getPassedIp is the ip you provided

  • if they are different this mean the data is for the ip of the machine that sent the request

  • The IpData opject is JsonSerializable .. Find more at THE PHP DOCS.