PHP pecl geoip since v1.1.1 from 2016 https://pecl.php.net/package-changelog.php?package=geoip&release=1.1.1 supports 3 new functions geoip_country_code_by_name_v6(), geoip_country_code3_by_name_v6() and geoip_country_name_by_name_v6() which unfortunately are not mentioned in official PHP doc: https://www.php.net/manual/en/ref.geoip.php Functions require file GeoIPv6.dat. Note that city info for IPv6 is not supported.
$countryCode = (strpos($ip, ":") === false) ? geoip_country_code_by_name($ip) : geoip_country_code_by_name_v6($ip);
https://stackoverflow.com/questions/30113161/getting-ipv6-support-with-php5-geoip-and-maxmind-database