lookup(string $ipaddr = '')
GeoIP an address, and return the country, state / province, and city. Uses MaxMin free goecitylite database.
IP address to look up. Defaults to self::$ip_address.
Small one method class that allows efficient geo lookups of IP addresses.
This class is available within the services container, meaning its methods can be accessed statically via the service singleton as shown below.
use apex\app; use apex\svc\geoip;
// Lookup user's IP address $ip = geoip::lookup(); print_r($ip);