PHP Library for retrieving the geolocation of ip addresses.
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.