Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.
/ php-geoip Public archive

Retrieves the geolocation of IP addresses using RDAP and hostnames.

License

Notifications You must be signed in to change notification settings

beranek1/php-geoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoIP

PHP Library for retrieving the geolocation of ip addresses.

Usage

All you need to do is including "geoip.php":

include  "geoip.php";

GeoIP consists of 4 functions:

  • get_country_by_host($host)
  • get_country_by_ip($ip)
  • get_country_by_rdap($query)
  • get_continent_by_country($country)

What they do is already obvious by their name, the return value is either a two character country/continent code or null if the location is unknown.

"get_country_by_rdap($query)" uses the RDAP protocol for getting the ip address' location, works for all european ones.

Affiliated projects

Releases

No releases published

Packages

No packages published

Languages