function mymail_ip2Country($ip = '', $get = 'code') { if (!mymail_option('trackcountries')) { return 'unknown'; } if (empty($ip)) { $ip = mymail_get_ip(); } require_once MYMAIL_DIR . '/classes/libs/Ip2Country.php'; $i = new Ip2Country(); $code = $i->get($ip, $get); return $code ? $code : 'unknown'; }
/** * Convenience alias function for getting the full country name instead of the country code * * @param null $ipAddress Optinoal * * @return string The name of the country where the IP address is from */ public static function getFull($ipAddress = null) { return Ip2Country::get($ipAddress, 'country_name'); }